Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Help--"Quoted String not Properly Terminated"?
Environment:
Oracle 8.0.5
VB program using Microsoft ODBC for Oracle (NOT Microsoft Oracle Driver)
This is driving me nuts. I've got a program with lots of selects & inserts in various spots, which work okay. But the problem I'm describing here is just bafflihg me.
When I go to insert some information programmatically, using:
dbCOSMOS.Execute ("Insert into tblincidenthistory " & _
"(key, date_r, pcnnumber, callnumber, technician, routedto, " &
vbCrLf & _
"description, category, componentserviced, resolutioncode) " &
_
"values " & _
"(ih_seq.nextval, " & vbCrLf & _
"to_date('" & Format(.m_dDate, "MM/DD/YYYY hh:mm:ss AMPM") &
"','MM/DD/YYYY HH:MI:SS AM'), " & _
"'" & mvarm_sPCNNumber & _
"', " & mvarm_nCallNumber & _
", '" & Trim(.m_sTechnician) & _
"', '" & .m_sRoutedTo & "'," & vbCrLf & _
"'" & .m_sDescription & "'," & vbCrLf & _
"'" & .m_sCategory & _
"', " & .m_nComponentServiced & _
", " & .m_nResolutionCode & ")")
I get the following errors:
SQL Server Error # 0 NA000: [Microsoft][ODBC driver for Oracle][Oracle]ORA-01756: quoted string not properly terminated SQL Server Error # 1 ODBC--call failed.
But, when I dump the *same* *exact* *string* into a text file, and cut-and-paste into SQL*Plus, it works perfectly:
Insert into tblincidenthistory (key, date_r, pcnnumber, callnumber,
technician, routedto,
description, category, componentserviced, resolutioncode) values
(ih_seq.nextval,
to_date('11/15/1999 09:48:21 AM','MM/DD/YYYY HH:MI:SS AM'), '119721', 6,
'kaw28 ', '', 'this is a test summary', 'Opened', 0, 0)
I thought, for a while, that I had figured it out--that the string was reaching SQL*Plus without any returns, so the SQL statement was being "virtually wrapped" in the midst of a character string. So I made sure to insert the carriage returns programmatically, so no character string was being broken by a "virtual" carriage return. (That's why all the "vbCrLf"s in the code.) Alas, that didn't seem to make any difference.
I've searched on DejaNews...I've tried the OTN site...The only ideas I've encountered are the "don't break your string across a line" and one person who suggested changing the SQL*Plus termination character, but that doesn't apply here...
HELP! If you have *any* clue, I'd appreciate some info.
Please reply via email as well...
Kate Received on Mon Nov 15 1999 - 11:23:12 CST