Re: Insert statement using '#session.arrBasketLit[Request.idx][3]#',
I had a similar problem recently and fixed it by setting a new variable... eg: cfset insertstring=request.idx It seemed to escape the single quote... good luck At 11:59 AM 5/9/02 -0600, you wrote: When using the Request.idx session variable, and the variable has an apostrophe in a string, it creates the following error. Error Diagnostic Information ODBC Error Code = 37000 (Syntax error or access violation) [Microsoft][ODBC SQL Server Driver][SQL Server]Line 21: Incorrect syntax near 'l'. The error occurred while processing an element with a general identifier of (CFQUERY), occupying document position (75:1) to (75:65). Anyone know how to work around this? You help would be appreciated. Dave Clay Trusjoist.com __ 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 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Insert Statement
I'm not sure what your "main" database is, but standard SQL supports an Insert Into Select From statement. In Access the query would look like: INSERT INTO Table1 ( Field1, Field2 ) SELECT Field1, Field2 FROM Table2 Of course, your SELECT statement can include a WHERE clause to choose the proper records, etc. Bob -Original Message- From: Joseph Vincent [mailto:[EMAIL PROTECTED]] Sent: Tuesday, October 24, 2000 4:27 PM To: CF-Talk Subject: Insert Statement I am running a query that selects 49,000 records from our main database...then I'm turning right around and inserting these records into an Access database for another use. The problem is that this takes FOREVER!! (about 10-12 minutes). When I insert the records I am looping with the CFOUTPUT query = "1st query" tag and using INSERT INTO for each iteration of the loop. I'm just wondering if there is anyway to insert all of the records I selected in the 1st query at one time? _ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. Share information about yourself, create your own public profile at http://profiles.msn.com. Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message with 'unsubscribe' in the body to [EMAIL PROTECTED] Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message with 'unsubscribe' in the body to [EMAIL PROTECTED]
RE: Insert Statement
Use a stored procedure, make a connection to the destination database, and copy the table that way? Completely bypassing CF. Lon Lentz Applications Developer CyberEntomologist - Alvion Technologies DataWarehousing and List Sales - Market Your Lists on the Net! [EMAIL PROTECTED] 941-574-8600 Ext. 210 -Original Message- From: Joseph Vincent [mailto:[EMAIL PROTECTED]] Sent: Tuesday, October 24, 2000 4:27 PM To: CF-Talk Subject: Insert Statement I am running a query that selects 49,000 records from our main database...then I'm turning right around and inserting these records into an Access database for another use. The problem is that this takes FOREVER!! (about 10-12 minutes). When I insert the records I am looping with the CFOUTPUT query = "1st query" tag and using INSERT INTO for each iteration of the loop. I'm just wondering if there is anyway to insert all of the records I selected in the 1st query at one time? _ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. Share information about yourself, create your own public profile at http://profiles.msn.com. Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message with 'unsubscribe' in the body to [EMAIL PROTECTED] Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message with 'unsubscribe' in the body to [EMAIL PROTECTED]