Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Runtime Error while using Dynamic Selection

Former Member
0 Likes
844

Hi,

We are getting a runtime error while using a dynamic selection. One of the fields has got an apostrophe in the middle of the text and so the condition is returning an error SAPSQL_WHERE_PARANTHESES.

Let's say the value in the field is SCV's. So the WHERETAB is filled as 'SCV's' or `SCV's`. An exception is caught in this case as there is no closing apostrophe.

Let us know if anyone has come across a similar issue and any help is appreciated.

Regards,

Sarves

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
755

You have to parse the text that you are concatenating into your dynamic WHERE an replace all occurrences of ' with '' (two single quotes).

Rob

5 REPLIES 5
Read only

kesavadas_thekkillath
Active Contributor
0 Likes
755

concatenate 'SCV' `'` 's' into var. now try using var in your where clause.

or build a range with option CP, the value in low must be like SCV+S. Later after selecting you can filter it with comparing the apostrophe.

Read only

0 Likes
755

Thanks for the reply

I just gave SVC's as an example. The value will be dynamic it can be abcd's pqrs's or anything like this. and i don't know how many apostrophes will be there for that particular line.

Read only

0 Likes
755

May be you can use ranges where you have to replaace all the apostrophes with *. Then in options you have to use CP.

after select filter the entries based on the actual apostrophe values.

Read only

Former Member
0 Likes
756

You have to parse the text that you are concatenating into your dynamic WHERE an replace all occurrences of ' with '' (two single quotes).

Rob

Read only

Clemenss
Active Contributor
0 Likes
755

Hi Sarves,

as Rob said.

check also the [ORACLE FAQS|http://www.orafaq.com/faq/how_does_one_escape_special_characters_when_writing_sql_queries] or [SQL SERVER u2013 How to Escape Single Quotes|http://blog.sqlauthority.com/2008/02/17/sql-server-how-to-escape-single-quotes-fix-error-105-unclosed-quotation-mark-after-the-character-string/]

Honestly: Before posting here and getting a whole lot of more or less useless comments just use your favorite search engine.

Regards,

Clemens