You don't need the second query.
<cfquery ....
insert into tableB (fieldnameA, fieldnameB, fieldnameC)
select field1, field2, field3 from tableA WHERE T.userID = <cfqueryparam cfsqltype="cf_sql_int"
value="#FORM.userID#">
</cfquery>
Nick Han
>>> [EMAIL PROTECTED] 05/28/04 09:15AM >>>
Hi all,
I've never done this before, but how do you loop a query of, say 6 records,
and rewrite the output into another table?
1) Retrieve the records:
<cfquery name="getRecords" datasource="#REQUEST.dsn1#">
SELECT T.field1, T.field2, T.field3
FROM tableA T
WHERE T.userID = <cfqueryparam cfsqltype="cf_sql_int"
value="#FORM.userID#">
</cfquery>
3) Here's the table to insert the records to:
<cfquery name="putRecords" datasource="#REQUEST.dsn1#">
INSERT INTO tableB
(fieldnameA, fieldnameB, fieldnameC)
VALUES (#getRecords.field1#, #getRecords.field2#,
#getRecords.field3#)
</cfquery>
Thanks, Mark
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

