Forgot to mention that the update of the field in database (data2) has to be inserted 
into the proper field based on username which I'm saving to the "auth" varaible.

The INSERT is not working properly. I'm sure of the proper syntax of this line "#auth# 
= 'strUsername'

If the user is Bill which is a field (strUsername) in database (data2) then insert the 
results from "#commalist#" into field "strField1"


<cfquery name="GetAlias" datasource="data1" dbtype="ODBC">
        SELECT      env_var
        FROM        alias
</cfquery>

<cfset commalist = valuelist(GetAlias.env_var)>
<cfquery name="Insert" datasource="data2" dbtype="ODBC">
        INSERT      into profs
        (strField1)
        VALUES
        ('#commalist#')
        WHERE           #auth# = 'strUsername'
</cfquery>



On Tue, 29 Oct 2002 17:24:58 -0000, Dave Wilson wrote:

> use <cfset strVar = Valuelist(GetAlias.env_var)> to create a comma delimited
> list.
> 
> -----Original Message-----
> From: FlashGuy [mailto:flashmx@;rogers.com]
> Sent: 29 October 2002 17:13
> To: CF-Talk
> Subject: Reading database and inserting fields into another database
> 
> 
> HI,
> 
> I need to read in the field "env_var" from one database ("data1") and insert
> the results into another database as a comma-delimited text.
> 
> <cfquery name="GetAlias" datasource="data1" dbtype="ODBC">
>       SELECT      env_var
>       FROM        data1
> </cfquery>
> 
> Output example:
> 
> file1 file2 file3 file4 file5 etc...
> 
> Insert results of GetAlias.env_var into database ("data2") into field
> "strVar" as a comma-delimited field.
> 
> strVar = "file1,file2,file3,file4,file5,etc...
> 
> Can I do this with just
> 
> 
> 
> ---------------------------------------------------
> Colonel Nathan R. Jessop
> Commanding Officer
> Marine Ground Forces
> Guatanamo Bay, Cuba
> ---------------------------------------------------
> 
> 
> 
> 
> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.

Reply via email to