Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

linking 2 different odbc datasources with CF

Status
Not open for further replies.

MarkCE

Programmer
Jul 31, 2000
2
GB
Using CF and Access, I want to append the contents of a table in datasource A onto the end of an identical table in a different datasource B (a completely different database).<br>I suppose I could read into an array and then loop thru the array INSERTing VALUES into the new table, but is there a simpler way?
 
One way, but maybe not the best, is to make one query<br>from datasource A and loop the query and put the data <br>into datasource B.<br><br>Example:<br><br>&lt;CFQUERY NAME=&quot;q_a&quot; DATASOURCE=&quot;a&quot;&gt;<br>SELECT table_a.column_a1,table_a.column_a2 FROM table_a<br>&lt;/CFQUERY&gt;<br><br>&lt;CFLOOP QUERY=&quot;q_a&quot;&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;CFQUERY NAME=&quot;q_b&quot; DATASOURCE=&quot;b&quot;&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;INSERT INTO table_b (column_b1,column_b2)<br>&nbsp;&nbsp;&nbsp;&nbsp;VALUES ('#column_a1#','#column_a2#')<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;/CFQUERY&gt;<br>&lt;/CFLOOP&gt;<br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top