I\'m using OLEDB provider for ADO.Net connecting to an Oracle database. In my loop, I am doing an insert:
insert into ps_tl_compleave_tbl values(\'2626899\'
In Oracle the semi-colon ';' is only used in sqlplus. When you are using ODBC/JDBC, OLEDB, etc you don't put a semi-colon at the end of your statement. In the above case you are actually executing 2 different statements so the best way to handle the problem is use 2 statements instead of trying to combine into a single statement since you can't use the semi-colon.
The issue may be that you have a parameter variable that is null being inserted into the query. That was what my problem was. Once I gave the parameter a default value of empty string, it worked.
semi colon after the first insert?
The ADO.NET OLE DB provider is for generic data access where you don't have a specific provider for your database. Use OracleConnection et al in preference to OleDbConnection for an Oracle database connection.
Oracle SQL uses a semi-colon ; as its end of statement marker.
you will need to add the ; after bother insert statments.
NB: that also assumes ADODB will allow 2 inserts in a single call.
the alternative might be to wrap both calls in a block,
BEGIN
insert (...) into (...);
insert (...) into (...);
END;
Is the semicolon needed from OLE_DB ? It's not needed from most API's ?