Re: CFC Function Style

2005-12-18 Thread Barney Boisvert
Now it seem that the functionality of the two queries is close enough that you could do something like this (option #1): SELECT id, name FROM my_table WHERE col = ORDER BY name, id If that works for your situation, that's what I'd do, I think. Unless the name field is friggin' huge (which I

Re: CFC Function Style

2005-12-18 Thread Aaron Rouse
I would think because sometimes you would need to pass in not only the field names to select but also some criteria as to how it is grabbed. Such as something that needs to go into the FROM or WHERE portions of the query. For the example Russ gave you would need to pass in the name of the column(c

Re: CFC Function Style

2005-12-18 Thread Stan Winchester
PROTECTED] >Sent: Sunday, December 18, 2005 2:11 PM >To: CF-Talk >Subject: Re: CFC Function Style > >Using the third style, the first SQL is looking for a single piece of data >(an int) while the second SQL is looking for 2 (and int and a varchar). The >first is also using a

RE: CFC Function Style

2005-12-18 Thread Russ
nters WHERE center= ORDER BY center -Original Message- From: Michael Dinowitz [mailto:[EMAIL PROTECTED] Sent: Sunday, December 18, 2005 2:11 PM To: CF-Talk Subject: Re: CFC Function Style Using the third style, the first SQL is looking for a single piece of data (an int)

Re: CFC Function Style

2005-12-18 Thread Aaron Rouse
I did something similar to the 1st then with the exception of I did not do a check to see if the argument existed. I had two arguments one being "ID" and the other "LEVEL" Both required but with a default set to the "LEVEL" So I would then do a check to see if Arguments.LEVEL NEQ "whatever the de

Re: CFC Function Style

2005-12-18 Thread Michael Dinowitz
Using the third style, the first SQL is looking for a single piece of data (an int) while the second SQL is looking for 2 (and int and a varchar). The first is also using a param where the second doesn't have one. I just don't like returning more data than is needed. Select centerid from

Re: CFC Function Style

2005-12-18 Thread Aaron Rouse
Just recently I did the first option and it was more from the stand point of I did not see any value to having a separate function for each need like this. Seems like there is not a huge difference between the 1st and 3rd, both use a CFIF to decide how the output of the function is going to be. On

CFC Function Style

2005-12-18 Thread Michael Dinowitz
This is more of a style question than anything else. Lets say you have a CFC that will be doing all the work for an application. There is need for two different queries. The first gets an ID based on a passed value. The second uses the same table but returns the id as well as a name and does not