I am getting an error which can be seen below when I am preparing the query:
SQL-ERR:Preparation of INSERT Query Failed: Ora-Err: -1756 ORA-01756:
quoted string not properly terminated
The query is as follows:
EXEC SQL declare INSDTA STATEMENT;
EXEC SQL PREPARE INSDTA FROM :stmt;
if(sqlca.sqlcode < 0)
{
DEBUG_LOG("SQL-ERR:Preparation of INSERT Query Failed: Ora-Err: %d %s\n", sqlca.sqlcode, sqlca.sqlerrm.sqlerrmc);
DEBUG_LOG("The Query is: %s\n", insertQuery);
return PREPARATION_FAILURE;
}
And the query from the log file is:
INSERT INTO TABLENAME
VALUES (
'00000001',
'00004467',
'0',
'R56565',
'03404395',
'20110601',
'999',
'87685785',
'2017-01-10-23.05.26.000000',
'KRMAR',
'KRMAR',
'77898878',
'03',
'00000001',
'U',
'01',
'1',
'87685785',
'R56565',
'89878988',
'cde',
'Andr\351',
'[email protected]',
'01192966',
'HGJF',
'00000000',
'',
'900429',
'1',
'98989897',
'',
'Aargau / Solothurn (CIC)',
'VCD',
'RB9',
'VCD',
'Observer'
)
If I execute it manually, the data is getting inserted.
But programatically it is failing for many such rows.
Note that the input text for insert query contains special chars like é
, ü
.
Also, the same program is working on development system perfectly. But on the production, it is failing.
Manual insertion is working on production properly.
What might be the issue? Any configuration issues?
Thanks in advance.
Since \
is the escape character, I think the error comes from 'Andr\351'
which should probably be 'André'
.
Remove backslash characters from your query just to check if this is the real cause.