cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

callablestatement

Former Member
0 Kudos
2,211

Good Night in my timezone.

I am using Sybase ase 15 , and i have a store procedure with two input parameters both VARCHAR ,basically inside the store procedure i use dynamic SQL , something like this:

@CMD = 'select * from TABLE where COL IN'+@PARAM1+'AND COL2=@PARAM2 EXEC(@cmd)

I call this procedure using JDBC like this way:

CallableStatement stmt = conn.prepareCall("{call MyStoreProcedure(?,?)}");

stmt.setString(1, "'''0'',''1'''"); stmt.setString(2, '''fr'''); stmt.executeQuery();

It throws me an error informing that the call is malformed. But if i run the call directly in the IDE like this :

EXEC MyStoreProcedure'''0'',''1'',''2'',''3'',''4'',''5 '',''6'',''7''','''fr'''

It runs without any problem, so i guess that there is some problem with the character escaping i guess.

Anyone had experience this problem ?

With the best regards Thanks in advance

Accepted Solutions (0)

Answers (0)