whereclause results in: SELECT * FROM dmImage WHERE 0=0

View: New views
3 Messages — Rating Filter:   Alert me  

whereclause results in: SELECT * FROM dmImage WHERE 0=0

by Marco van den Oever :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Although data is in place and matches the relationships, still, with
below code i see "SELECT * FROM dmImage WHERE 0=0", why???

<!--- if attached, get the images from dmimage --->
<cfset obj = createObject
('component',application.stcoapi.dmimage.typePath) />
<cfset stprops = {} />
  <cfset stprops.whereclause="(objectid) IN (SELECT data FROM
#application.dbowner#emailberichten_aemailafbeeldingen WHERE
#application.dbowner#emailberichten_aemailafbeeldingen.parentid =
'#stobj.objectid#')" />
<cfset emailafbeeldingen = obj.getmultiplebyquery
(stProperties=stprops) />

Thanks.
--~--~---------~--~----~------------~-------~--~----~
You received this message cos you are subscribed to "farcry-dev" Google group.
To post, email: farcry-dev@...
To unsubscribe, email: farcry-dev+unsubscribe@...
For more options: http://groups.google.com/group/farcry-dev
--------------------------------
Follow us on Twitter: http://twitter.com/farcry
-~----------~----~----~----~------~----~------~--~---


Re: whereclause results in: SELECT * FROM dmImage WHERE 0=0

by Tomek Kott :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Unless i'm tracing back the type definition incorrectly what you need is:

<cfset emailafbeeldingen = obj.getmultiplebyquery
(whereClause=stprops.whereClause) />

i.e., the function definition takes the whereClause, not the object properties...
(looked in /core/packages/fourq/fourq.cfc) I have 5.1.9.
On Fri, Oct 30, 2009 at 5:11 PM, Marco van den Oever <marcovandenoever@...> wrote:

Although data is in place and matches the relationships, still, with
below code i see "SELECT * FROM dmImage WHERE 0=0", why???

<!--- if attached, get the images from dmimage --->
<cfset obj = createObject
('component',application.stcoapi.dmimage.typePath) />
<cfset stprops = {} />
 <cfset stprops.whereclause="(objectid) IN (SELECT data FROM
#application.dbowner#emailberichten_aemailafbeeldingen WHERE
#application.dbowner#emailberichten_aemailafbeeldingen.parentid =
'#stobj.objectid#')" />
<cfset emailafbeeldingen = obj.getmultiplebyquery
(stProperties=stprops) />

Thanks.



--~--~---------~--~----~------------~-------~--~----~
You received this message cos you are subscribed to "farcry-dev" Google group.
To post, email: farcry-dev@...
To unsubscribe, email: farcry-dev+unsubscribe@...
For more options: http://groups.google.com/group/farcry-dev
--------------------------------
Follow us on Twitter: http://twitter.com/farcry
-~----------~----~----~----~------~----~------~--~---


Re: whereclause results in: SELECT * FROM dmImage WHERE 0=0

by Marco van den Oever :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


You are the man! I am trying to understand this, and understand why i
can't see this myself. Is this something you just need to know, or am
i still missing the logic behind it?

I am thinking like "the whereclause is in the function so when the
function gets a whereclause it uses it", so when using stproperties
the function sees only the whereclause and uses it.

On Oct 30, 10:21 pm, Tomek Kott <tkott.s...@...> wrote:

> Unless i'm tracing back the type definition incorrectly what you need is:
>
> <cfset emailafbeeldingen = obj.getmultiplebyquery
> (whereClause=stprops.whereClause) />
>
> i.e., the function definition takes the whereClause, not the object
> properties...
> (looked in /core/packages/fourq/fourq.cfc) I have 5.1.9.
> On Fri, Oct 30, 2009 at 5:11 PM, Marco van den Oever <
>
> marcovandenoe...@...> wrote:
>
> > Although data is in place and matches the relationships, still, with
> > below code i see "SELECT * FROM dmImage WHERE 0=0", why???
>
> > <!--- if attached, get the images from dmimage --->
> > <cfset obj = createObject
> > ('component',application.stcoapi.dmimage.typePath) />
> > <cfset stprops = {} />
> >  <cfset stprops.whereclause="(objectid) IN (SELECT data FROM
> > #application.dbowner#emailberichten_aemailafbeeldingen WHERE
> > #application.dbowner#emailberichten_aemailafbeeldingen.parentid =
> > '#stobj.objectid#')" />
> > <cfset emailafbeeldingen = obj.getmultiplebyquery
> > (stProperties=stprops) />
>
> > Thanks.
--~--~---------~--~----~------------~-------~--~----~
You received this message cos you are subscribed to "farcry-dev" Google group.
To post, email: farcry-dev@...
To unsubscribe, email: farcry-dev+unsubscribe@...
For more options: http://groups.google.com/group/farcry-dev
--------------------------------
Follow us on Twitter: http://twitter.com/farcry
-~----------~----~----~----~------~----~------~--~---