Please be aware that the content in SAP SQL Anywhere Forum will be migrated to the SAP Community in June and this forum will be retired.

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

asked 29 May '13, 19:48

tt0686's gravatar image

tt0686
0222
accept rate: 0%

closed 29 May '13, 21:26

Mark%20Culp's gravatar image

Mark Culp
25.0k10142298

1

This site is specifically for questions about SAP Sybase SQL Anywhere. Questions about ASE should be asked on the SCN (SAP Community Network) over here.

(29 May '13, 21:05) Graeme Perrow

The question has been closed for the following reason "Question is off-topic or not relevant" by Mark Culp 29 May '13, 21:26

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×125
×78
×53

question asked: 29 May '13, 19:48

question was seen: 2,001 times

last updated: 29 May '13, 21:26