• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Malformed SQL92 - Please Help.

 
Alex Marks
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am dealing with the Callable Statement. Here is the code:

...
int id = 0;
String cal = "{ ? call returnlastrow }";
CallableStatement statement = null;
connection.prepareCall(cal);
statement.registerOutParameter(1,Types.INTEGER);
statement.execute();
id = statement.getInt(1);
statement.close();
...

I encounter an exception as : java.sql.SQLException: Malformed SQL92 string at position: 5. Expecting "=" got "c" 0

Please help me solve this problem. Thank you for your help.
 
Kevin Hurley
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is a very subtle syntax bug. I stared at this for a day or better trying to figure out what could be wrong.

You need to have:

{ ? = call yourpackage.yourfunction() }

instead of

{ ? call = yourpackage.yourfunction() }


Notice the syntax.
 
vaasu kanch
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Still i am getting the same error message.

Malformed SQL92 string at position: 53

i am using the function call as below :

{? = CALL pkg_OM_GetCOS.func_GetAssetList(?}

cstmt.registerOutParameter(1, OracleTypes.ARRAY,"STRING_ARRAY");
cstmt.setInt(2, docNum);
cstmt.execute();


Above function returns a STRING_ARRAY which is VARRAY Type.

my code gives exceptions while at cstmt.execute() statement ?

Any help !!!
 
Nikhil Silveira
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
vaasu,

JDBC drivers are quirky beings. You need to keep the call keyword lower-cased.

{? = call pkg_OM_GetCOS.func_GetAssetList(?}

Cheers,
Nikhil
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic