>Sorry I have two questions? > >1. How do you get a list of field names from an MS Access DB? > >2. I have two tables. I need to populate one with information from the >other both of the same structure. >I tried ><cfquery datasource=#db# Name=boo> >Select * from table123 ></cfquery> > ><cfoutput query=boo> ><cfinsert datasource=DB2 tablename=tablexyz> > >I dont want to have to write all the fields out. >
The quick answer to your question is "queryname.ColumnList" which returns a comma-delimited list of columns returned. However, why not use SQL to do the work for you using an INSERT INTO-SELECT statement, i.e., INSERT INTO myTable1 ( column1, column2, column3 ) SELECT column1, column2, column3 FROM myTable2 [WHERE myTable1.column1 = myTable2.column2] The WHERE clause in brackets is optional if you want to filter the data to select. What that query will do is insert the data from myTable2 into myTable1 all in one shot. Regards, Dave. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Signup for the Fusion Authority news alert and keep up with the latest news in ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

