The problem is that the original query I had for query1 returned a value sometimes, because it was doingn something like
If not exists Select tableid from table where somefield=#somevalue# Begin Insert into table (somefield) values (#somevalue#) Select @@identity as tableid End Which was returning a value when the record wasn't previously in the db, but I have fixed is since to return a value in both instances. Russ > -----Original Message----- > From: Qasim Rasheed [mailto:[EMAIL PROTECTED] > Sent: Thursday, August 17, 2006 8:03 PM > To: CF-Talk > Subject: Re: ColdFusion var bug? > > Rick, > > I did tested those scenarios and your suspicions are correct as it works > in > both these cases > > A, the DML wasn't named > B. Two queries were both select. > > Thanks, > Qasim > > On 8/17/06, Rick Root <[EMAIL PROTECTED]> wrote: > > > > Qasim Rasheed wrote: > > > I would say it's a bug as I can verify this on my local CFMX7 server. > It > > > seems that if you have a DML statement i.e. delete,update or insert > and > > you > > > have named that query and if you do a select query afterwards with the > > same > > > query name, CF copies the name to the variables scope. Really strange. > > > > I can't try it right now, but it'd be interesting to see if the same > > thing would happen if you didn't name the DML query ... since DELETE and > > UPDATE statements don't actually return anything, if you try to access > > the named variable afterwords it is undefined. > > > > I suspect that all would be fine if: > > > > A - the DML query wasn't named > > or > > B - the two queries were both SELECT statements. > > > > Rick > > > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:250250 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4