Problem creating package body via JDBC: Non supported SQL92 token [message #432366] |
Mon, 23 November 2009 18:28 |
pchernik
Messages: 2 Registered: November 2009
|
Junior Member |
|
|
Hi All,
I'm getting an exception while trying to do a "create package body" from within my Java application.
java.sql.SQLException: Non supported SQL92 token at position: 6805: v_Counter
I'm on Oracle 9.2.0.4, and exactly same "create package body" call works w/o issues from within sqlplus.
I googled a possible solution, to use execute immediate:
String sql =
"DECLARE\n" +
"v_command VARCHAR2(32767);\n" +
"BEGIN\n" +
"v_command := ?;\n" +
"EXECUTE IMMEDIATE v_command;\n" +
"END;";
Statement stat = conn.PrepareStatement(sql);
stat.setString(1, createScript);
stat.executeUpdate();
But the problem is - my create package script is about 100KB...
Any suggestions are appreciated.
Thanks,
-Pavel
[Updated on: Mon, 23 November 2009 21:52] Report message to a moderator
|
|
|
|
Re: Problem creating package body via JDBC: Non supported SQL92 token [message #432409 is a reply to message #432392] |
Tue, 24 November 2009 00:19 |
pchernik
Messages: 2 Registered: November 2009
|
Junior Member |
|
|
Michel Cadot wrote on Mon, 23 November 2009 23:20As there is no v_Counter in what your posted, we can only say you: check your quotes and double quotes in your statement.
Regards
Michel
v_Counter is a variable inside my package body.
I found a solution to my problem here:
www.ulaska.com/oracle/copy_object_between_schemas.html
Basically my objective is to be able to create arbitrary size packages and package bodies by using JDBC. For whatever reason, the calls fail due to "Non supported SQL92 token" error. Same exact create statements works like a charm from sqlplus.
So, my workaround here is to create a temp table similar to user_source and use the procedure described in the above mentioned link, to create the actual packages and package bodies.
|
|
|