Hi,
I'm just starting out using Borland C++ and I've hit a problem that will be down to my lack of knowledge of the classes and functions that are available.
Anyway...
I am trying to execute an Oracle stored procedure using the following code:
Running this code results in an ORA-00900:Invalid SQL statement error. Researching this I know this occurs using execute immediate for SQL*Plus commands so I'm guessing this is the issue here, but I don't know what to try to fix it. Can anyone offer me any pointers?
Note: The procedure works when run from SQL*Plus using exactly the command in the code above. So I know the procedure compiles and runs.
Thanks.
I'm just starting out using Borland C++ and I've hit a problem that will be down to my lack of knowledge of the classes and functions that are available.
Anyway...
I am trying to execute an Oracle stored procedure using the following code:
TQuery* q = NULL; (This is declared in DBTables.HPP - Which I believe is a Borland class)
try
{
try
{
q = new TQuery(NULL);
q->SQL->Text = "EXECUTE ownername.storedprocedurename('" + parametervalue + "')";
q->ExecSQL();
}
catch(Exception& e)
{
//Error message blah, blah...
}
}
__finally
{
if(NULL != q)
{
q->Active = false;
delete q;
q = NULL;
}
}
(Most of this code has been taken from existing code else where in the application, as I'm new to this stuff I probably wont be able to answer any "why have you done that?" questions.)
Running this code results in an ORA-00900:Invalid SQL statement error. Researching this I know this occurs using execute immediate for SQL*Plus commands so I'm guessing this is the issue here, but I don't know what to try to fix it. Can anyone offer me any pointers?
Note: The procedure works when run from SQL*Plus using exactly the command in the code above. So I know the procedure compiles and runs.
Thanks.