Hi,
first of all I would like to thank you very much for the tremendous work you have done! OCILIB saved me a lot of time and nerves digging into classic OCI.
I have recently started using you C++ wrapper and I have a very particular problem.
When I try to execute "bad" SQL statement which is of type "create function" or "create procedure", the method Statement::execute never returns.
Say we have:
As you can see - line 3 does not end with semicolon and is supposed to generate an error.
When I execute code:
ostringhomeLibs("/home/oracle/app/oracle/Oracle11g/lib");Environment::Initialize(Environment::Default|Environment::Threaded,homeLibs);Environment::EnableWarnings(true);...Connectionconn;conn.Open(dbs,usr,pwd,Environment::SessionDefault);try{Statementstmt(conn);stmt.Execute(ostring("create or replace function err_testing return date \n\ is \n\ v_date date \n\ begin \n\ v_date := sysdate; \n\ return v_date; \n\ end;\n"));//theprogramneverreachesthispointandexceptionisnotthrownaswell}catch(Exceptionex){ocout<<OTEXT("Exception was catched: ")<<ex.what()<<std::endl;}conn.Close();ocout<<OTEXT("Done.");
the program stops at "stmt.Execute" and never exits.
If I correct the error in the SQL, the function is created and compiled without a problem.
If the statement is just "declare ... begin ... end;" style, it throws an exception well and an error text is shown.
Is there any way to workaround this?
Thank you!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I've just tried and with warning on, an exception is raised as expected.
Get latest sources. It has been fixed few weeks ago in the GIT repo.
Version 4.1.0 is finally getting released this week :)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2015-05-06
Hi!
I didn't expect you answer so fast ;). Thank you!
Yes, the new version fixed the problem. Now it reports with a proper Oracle error.
Thank you again!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2015-05-06
Unfortunately there is another issue with the new version:
When getting datatype of column for a resultset, the returned value for GetColumn() is "?".
...for(registerinti=1;i<=m_columnCount;++i)//column index is 1-based{ocilib::Columncolumn=resultset.GetColumn(i);ostringfieldType=column.GetSQLType();// fieldType is now "?"...}
The funny part is that when using GetFullSQLType() I get the full name and size appropriately.
I use the ANSI version of the library. Latest release 4.1.0.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Arrgh ! It was due missing break statements in column.c file that disappeared while performing a nasty code replace operation at so point !
I've commited the fix. You need to rebuild the library.
I will release a 4.1.1 this evening...
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2015-05-07
I compiled the lib from the snapshot and it is OK now.
Thank you!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
first of all I would like to thank you very much for the tremendous work you have done! OCILIB saved me a lot of time and nerves digging into classic OCI.
I have recently started using you C++ wrapper and I have a very particular problem.
When I try to execute "bad" SQL statement which is of type "create function" or "create procedure", the method Statement::execute never returns.
Say we have:
As you can see - line 3 does not end with semicolon and is supposed to generate an error.
When I execute code:
the program stops at "stmt.Execute" and never exits.
If I correct the error in the SQL, the function is created and compiled without a problem.
If the statement is just "declare ... begin ... end;" style, it throws an exception well and an error text is shown.
Is there any way to workaround this?
Thank you!
Hi,
can you indicate the ocilib version (released packages version , latest sources) ? Ansi build ? Unicode build ?
thanks
vincent
Do you have the same issue when warnings are not enabled ?
if not, get latest sources, it shall be fixed :)
I've just tried and with warning on, an exception is raised as expected.
Get latest sources. It has been fixed few weeks ago in the GIT repo.
Version 4.1.0 is finally getting released this week :)
Hi!
I didn't expect you answer so fast ;). Thank you!
Yes, the new version fixed the problem. Now it reports with a proper Oracle error.
Thank you again!
Unfortunately there is another issue with the new version:
When getting datatype of column for a resultset, the returned value for GetColumn() is "?".
The funny part is that when using GetFullSQLType() I get the full name and size appropriately.
I use the ANSI version of the library. Latest release 4.1.0.
Ok I will fix that asap !
Arrgh ! It was due missing break statements in column.c file that disappeared while performing a nasty code replace operation at so point !
I've commited the fix. You need to rebuild the library.
I will release a 4.1.1 this evening...
I compiled the lib from the snapshot and it is OK now.
Thank you!
Good :)
You're welcome.
Vincent