if you really wanted to do things with farcry and to be cross-db operable, I
would suggest having two different sql statements:
1) SELECT data FROM #application.dbowner# rulebanners_abannerclients WHERE
#application.dbowner#rulebanners_abannerclients.parentid =
'#stObj.ObjectID#'
---- put that into a list form of with single quotes 'data1,data2,data3'
etc.
2) SELECT whatever FROM wherever WHERE (abannerclients) IN
(#listFromPrevious#) AND ...
So, you would use farcry to do the selects, and put in the WHERE by hand in
each case.
That's probably how I would do it knowing that old MySQL doesn't like
SELECTs within SELECTs.
Tomek
On Tue, Nov 25, 2008 at 8:20 AM, Marco van den Oever <
[EMAIL PROTECTED]> wrote:
>
> Ok thanks for this insight, so as i understand it, there is not really
> a method to create such code as above that will always work an each
> version of mysql and ms sql, bit like design in different browsers so
> to speak?
>
> On Nov 25, 4:00 am, "Blair McKenzie" <[EMAIL PROTECTED]> wrote:
> > Not really. In fact one of the issues that MySQL dbs can have is with
> > subqueries like you're using (mostly older versions).
> >
> > But for the DBs that FarCry officially supports, the kinds of queries
> most
> > people write won't be an issue.
> >
> > On Tue, Nov 25, 2008 at 1:53 PM, Marco van den Oever <
> >
> > [EMAIL PROTECTED]> wrote:
> >
> > > mm ok i thought it was not smart to do so as when you do it with
> > > Farcry functions there will be no problems with differences in mysql
> > > and ms sql etc, so these Farcry functions are not made to do so, i'm
> > > confused now.
> >
> > > for instance i use the below code to get banner id's for the banner
> > > plugin:
> >
> > > <!--- get the banner id's --->
> > > <cfset props = {} />
> > > <cfset props.whereclause="(abannerclients) IN (SELECT data FROM
> > > #application.dbowner#rulebanners_abannerclients WHERE
> > > #application.dbowner#rulebanners_abannerclients.parentid =
> > > '#stObj.ObjectID#') AND showstatus = 'onhits' AND hitsleft > 0" />
> > > <cfset onhits = obj.getMultipleByQuery(argumentCollection=props) />
> >
> > > as i thought this would use the farcry function and therefore also
> > > would process the code right if it was mysql or ms sql.
> >
> > > On Nov 25, 3:38 am, "Blair McKenzie" <[EMAIL PROTECTED]> wrote:
> > > > It sounds like you're trying to use FarCry functions to retrieve sets
> of
> > > > records. We don't usually bother, and just use cfquery.
> >
> > > > On Tue, Nov 25, 2008 at 11:13 AM, Marco van den Oever <
> >
> > > > [EMAIL PROTECTED]> wrote:
> >
> > > > > "Generally we wouldn't use a "select" function, we would do a
> direct
> > > > > query to
> > > > > the database."
> >
> > > > > So does that mean that stating the different parameters is named a
> > > > > "select function" and props.whereclause is a direct query to the
> > > > > database?
> >
> > > > > I am very new to this so not understanding every term you use yet
> :)
> >
> > > > > Thanks
> >
> > > > > On Nov 25, 1:01 am, "Blair McKenzie" <[EMAIL PROTECTED]> wrote:
> > > > > > Generally we wouldn't use a "select" function, we would do a
> direct
> > > query
> > > > > to
> > > > > > the database. If this is for a view, the returned items would be
> > > > > displayed
> > > > > > via a webskin.
> >
> > > > > > On Tue, Nov 25, 2008 at 10:25 AM, Marco van den Oever <
> >
> > > > > > [EMAIL PROTECTED]> wrote:
> >
> > > > > > > Well there is no problem anymore, but i would like the opinion
> of
> > > > > > > someone with more experience about the difference between using
> > > > > > > structure keys to define each parameter or just one
> > > props.whereclause
> > > > > > > and put it all in there.
> >
> > > > > > > When using props.whereclause i can put it all in there, when
> not
> > > using
> > > > > > > i have to state them all separately.
> >
> > > > > > > Is there difference in speed etc?
> >
> > > > > > > On Nov 24, 11:09 pm, "Blair McKenzie" <[EMAIL PROTECTED]>
> wrote:
> > > > > > > > What exactly are you trying to do? I can't tell what kind of
> > > problem
> > > > > > > you're
> > > > > > > > trying to solve.
> >
> > > > > > > > On Tue, Nov 25, 2008 at 3:02 AM, Marco van den Oever <
> >
> > > > > > > > [EMAIL PROTECTED]> wrote:
> >
> > > > > > > > > So it really doesn't matter if i do it with setting
> structure
> > > keys
> > > > > for
> > > > > > > > > the sql statement or just like:
> >
> > > > > > > > > <cfset props.whereclause="(abannerclients) IN (SELECT data
> FROM
> > > > > > > > > #application.dbowner#rulebanners_abannerclients WHERE
> > > > > > > > > #application.dbowner#rulebanners_abannerclients.parentid =
> > > > > > > > > '#stObj.ObjectID#') AND showstatus = 'onviews' AND
> viewsleft >
> > > 0"
> > > > > />
> >
> > > > > > > > > It uses the same function so speed etc is the same ?
> >
> > > > > > > > > Thanks
> >
> > > > > > > > > On Nov 24, 3:28 pm, Marco van den Oever <
> > > > > [EMAIL PROTECTED]>
> > > > > > > > > wrote:
> > > > > > > > > > Ok that is important to know, will change the code to
> > > structures.
> >
> > > > > > > > > > thanks
> >
> > > > > > > > > > On Nov 24, 1:39 am, "Blair McKenzie" <[EMAIL PROTECTED]>
> > > wrote:
> >
> > > > > > > > > > > formtools.cfc is intended to be used by the internals
> of
> > > > > > > objectadmin.
> > > > > > > > > I'd
> > > > > > > > > > > recommend against using it since it will probably be
> > > changed
> > > > > when
> > > > > > > we
> > > > > > > > > decide
> > > > > > > > > > > to rewrite objectadmin.
> >
> > > > > > > > > > > On Mon, Nov 24, 2008 at 11:21 AM, Marco van den Oever <
> >
> > > > > > > > > > > [EMAIL PROTECTED]> wrote:
> >
> > > > > > > > > > > > So what's your opinion about get the data with
> > > structures, or
> > > > > > > with
> > > > > > > > > > > > oFormtoolUtil?
> >
> > > > > > > > > > > > On Nov 24, 1:19 am, Marco van den Oever <
> > > > > > > [EMAIL PROTECTED]>
> > > > > > > > > > > > wrote:
> > > > > > > > > > > > > ahhhhww application.stCOAPI.xyz.packagepath, how
> simple
> > > can
> > > > > it
> > > > > > > be
> > > > > > > > > > > > > huh ? :)
> > > > > > > > > > > > > that for me was the missing link.
> >
> > > > > > > > > > > > > Thanks!
> >
> > > > > > > > > > > > > On Nov 23, 11:23 pm, "Blair McKenzie" <
> > > [EMAIL PROTECTED]>
> > > > > > > wrote:
> >
> > > > > > > > > > > > > > I'm not sure what you mean by structures. You
> aren't
> > > > > using
> > > > > > > any in
> > > > > > > > > the
> > > > > > > > > > > > > > examples you gave.
> >
> > > > > > > > > > > > > > When instantiating a content type or rule you
> should
> > > use
> > > > > > > > > > > > > > application.stCOAPI.xyz.packagepath. This will
> work
> > > for
> > > > > all
> > > > > > > rules
> > > > > > > > > and
> > > > > > > > > > > > all
> > > > > > > > > > > > > > types.
> >
> > > > > > > > > > > > > > Regarding formtools, you should never have to
> > > reference
> > > > > > > > > > > > > > farcry.core.packages.farcry.formtools. Everything
> you
> > > > > need is
> > > > > > > > > exposed
> > > > > > > > > > > > via
> > > > > > > > > > > > > > ft:object. To see how core uses it for edit forms
> you
> > > can
> > > > > > > have a
> > > > > > > > > look
> > > > > > > > > > > > in the
> > > > > > > > > > > > > > edit function on the types component.
> >
> > > > > > > > > > > > > > Blair
> >
> > > > > > > > > > > > > > On Mon, Nov 24, 2008 at 4:43 AM, Marco van den
> Oever
> > > <
> >
> > > > > > > > > > > > > > [EMAIL PROTECTED]> wrote:
> >
> > > > > > > > > > > > > > > In my attempt to use as much structures as
> possible
> > > i
> > > > > am
> > > > > > > > > rechecking
> > > > > > > > > > > > > > > code that is build with formtools, is it
> correct
> > > that
> > > > > using
> > > > > > > > > > > > structures
> > > > > > > > > > > > > > > is faster?
> >
> > > > > > > > > > > > > > > Trying now to use structures instead of query's
> > > with:
> >
> > > > > > > > > > > > > > > <cfset oFormtoolUtil =
> createObject("component",
> > > > > > > > > > > > > > > "farcry.core.packages.farcry.formtools") />
> >
> > > > > > > > > > > > > > > Is it correct that for rule table data you
> can't
> > > > > address
> > > > > > > > > without
> > > > > > > > > > > > using
> > > > > > > > > > > > > > > oFormtoolUtil?
> >
> > > > > > > > > > > > > > > You can't connect with:
> >
> > > > > > > > > > > > > > > <cfset obj = createObject
> >
> > > ('component',application.stcoapi.blablabla.typePath) />
> >
> > > > > > > > > > > > > > > as it is not an type.
> >
> > > > > > > > > > > > > > > You can't connect directly with:
> >
> > > > > > > > > > > > > > > obj.getData(stobj.objectid) (or with additional
> > > > > properties)
> >
> > > > > > > > > > > > > > > as the stobj.objectid refer to the rule table,
> so
> > > not
> > > > > > > directly
> > > > > > > > > to the
> > > > > > > > > > > > > > > data i need.
> >
> > > > > > > > > > > > > > > Even when it works out eventually then you
> might
> > > end up
> > > > > > > with a
> > > > > > > > > couple
> > > > > > > > > > > > > > > of structures to do the same you can do with
> one
> > > > > > > oFormtoolUtil
> > > > > > > > > setup.
> >
> > > > > > > > > > > > > > > What's your vision on this?
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"farcry-dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/farcry-dev?hl=en
-~----------~----~----~----~------~----~------~--~---