on 2013 May 29 8:48 PM
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
Request clarification before answering.
User | Count |
---|---|
39 | |
15 | |
9 | |
7 | |
5 | |
5 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.