I think that if you set the UserId to a non scoped variable in between the queries: QUERY_1 set UserID = QUERY_1.UserId QUERY_2 INSERT INTO Tracking UserID VALUES #UserID# I know that you always have to scope query variables, at least to my experience... Hope this helps, Tomas -----Original Message----- From: SHEETS, DAYV (PB) [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 19, 2001 4:02 PM To: CF-Server Subject: Passing DB Variables from one table Data Source to another How would one go about passing one database variable to another? Here's my dilemma; I have been asked to write a counter that will store the users ID in the table (in addition to IP/page/browser etc). Once the user is authenticated I would like to pass the users ID into my counter table. The problem is that it is not allowing me to do this. I have two separate Data Sources established 1) Temp (a.k.a counter) 2) login (a.k.a. the permission validation). For reference, here is my code: -counter.cfm- <cfquery datasource="temp"> Insert into Tracking( <cfif #CGI.path_translated# is not ""> RequestedFile, </cfif> <cfif #CGI.remote_host# is not ""> UserIP, </cfif> <cfif #CGI.HTTP_USER_AGENT# is not ""> ClientBrowser, </cfif> date_in,time_in,requestid) Values( <cfif #CGI.path_translated# is not ""> '#CGI.path_translated#', </cfif> <cfif #CGI.remote_host# is not ""> '#CGI.remote_host#', </cfif> <cfif #CGI.HTTP_USER_AGENT# is not ""> '#CGI.HTTP_USER_AGENT#', </cfif> #date_in#,#time_in#,#requestid#) </cfquery> -login.cfm- <cfquery name="getpermission" datasource="login"> select permissions from thepermissions where id ='#requestid#' </cfquery> </snip> Any help would be most appreciative! TIA, Dayv ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm ------------------------------------------------------------------------------ To unsubscribe, send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body or visit the list page at www.houseoffusion.com
RE: Passing DB Variables from one table Data Source to another
Tomas Becklin :: Web Developer Thu, 19 Apr 2001 17:10:33 -0700
- Passing DB Variables from one table Data So... SHEETS, DAYV (PB)
- Tomas Becklin :: Web Developer
