RE: CFQuery to Database
Thanks Russ, Scott@fussionapps has been kind enough to give me a nice code.. The little challenge was that the columns were not fixed and query results are completely dyanmic... Just posting it here for reference INSERT INTO SomeTable ( #qry_data.GetMetaData().GetColumnName(i)# , ) VALUES ( #variables.ColumnType# '#variables.ColumnData#' #variables.ColumnData# NULL , ) Note: small corrections may be required to the code. -Original Message- From: Russ Michaels [mailto:r...@michaels.me.uk] Sent: Sunday, March 11, 2012 1:48 PM To: cf-talk Subject: Re: CFQuery to Database if its just a few records then use query of query to get your subset of results and then insert the results into database B if this is a regular occurrence and happens often then then you may want to look at creating a DTS script on your SQL server and scheduling that to do the job. On Sat, Mar 10, 2012 at 10:32 PM, IT (Pradeep Viswanathan) < prade...@emiratesnbd.com> wrote: > > I have couple of records which are filtered from data source x which > is oracle based and require to insert it into datasource y which is MS > SQL server. > > The number of rows, columns is not fixed, however I have the records > in a Query object, what would be the best way to insert get this data > into the other database? > > Thanks in advance. > > > DISCLAIMER: > "This e-mail message including any of its attachments is intended > solely for the addressee(s) and may contain privileged information. If > you are not the addressee or you have received this email message in > error, please notify the sender who will remove your details from its > database. You are not authorized to read, copy, disseminate, > distribute or use this e-mail message or any attachment to it in any > manner and must delete the email and destroy any hard copies of it. > This e-mail message does not contain financial instructions or > commitments of any kind. Any views expressed in this message are those > of the individual sender and do not necessarily reflect the views of > Emirates NBD PJSC, or any other related subsidiaries, entities or persons." > > > ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:350350 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: CFQuery to Database
if its just a few records then use query of query to get your subset of results and then insert the results into database B if this is a regular occurrence and happens often then then you may want to look at creating a DTS script on your SQL server and scheduling that to do the job. On Sat, Mar 10, 2012 at 10:32 PM, IT (Pradeep Viswanathan) < prade...@emiratesnbd.com> wrote: > > I have couple of records which are filtered from data source x which is > oracle based and require to insert it into datasource y which is MS SQL > server. > > The number of rows, columns is not fixed, however I have the records in a > Query object, what would be the best way to insert get this data into the > other database? > > Thanks in advance. > > > DISCLAIMER: > "This e-mail message including any of its attachments is intended solely > for the addressee(s) and may contain privileged information. If you are not > the addressee or you have received this email message in error, please > notify the sender who will remove your details from its database. You are > not authorized to read, copy, disseminate, distribute or use this e-mail > message or any attachment to it in any manner and must delete the email and > destroy any hard copies of it. > This e-mail message does not contain financial instructions or commitments > of any kind. Any views expressed in this message are those of the > individual sender and do not necessarily reflect the views of Emirates NBD > PJSC, or any other related subsidiaries, entities or persons." > > > ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:350349 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
CFQuery to Database
I have couple of records which are filtered from data source x which is oracle based and require to insert it into datasource y which is MS SQL server. The number of rows, columns is not fixed, however I have the records in a Query object, what would be the best way to insert get this data into the other database? Thanks in advance. DISCLAIMER: "This e-mail message including any of its attachments is intended solely for the addressee(s) and may contain privileged information. If you are not the addressee or you have received this email message in error, please notify the sender who will remove your details from its database. You are not authorized to read, copy, disseminate, distribute or use this e-mail message or any attachment to it in any manner and must delete the email and destroy any hard copies of it. This e-mail message does not contain financial instructions or commitments of any kind. Any views expressed in this message are those of the individual sender and do not necessarily reflect the views of Emirates NBD PJSC, or any other related subsidiaries, entities or persons." ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:350341 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm