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

sql syntax error because of unicode character

Former Member
0 Likes
1,396

Hi forum,

I stumbled over a strange behavior when executing a SQL query where a specific character is part of.

Whenever I use    ( 25E81 from CJK Ideograph Extension B ) in any query, it throws an 'sql syntax error: incorrect syntax near ....'

If I remove the character, everything is fine.

This error is also occurring when SQL Editor of DBACOCKPIT.

Does someone know how to resolve this ?

Regards

Volker

6 REPLIES 6
Read only

retired_member
Product and Topic Expert
Product and Topic Expert
0 Likes
1,317

Could you supply a real code example?

Read only

0 Likes
1,317

Hi Horst, this is example where it fails.

data:

con type ref to CL_SQL_CONNECTION,

stmt type ref to CL_SQL_STATEMENT.

con = cl_sql_connection=>get_connection( 'DBCON' ).

stmt = con->create_statement( ).

stmt_txt =  'select ''  '' from DUMMY'.

stmt->execute_update( stmt_txt ).

Unfortunately I cannot put this characters into this thread. You need to replace the blank with the character.

Regards Volker

Read only

0 Likes
1,317

Uh-huh. So it is Native SQL via ADBC.

While I still don't see how I can connect the above code snippet to your problem (cause it runs for me after replacing literal 'DBCON' with a real connection and I don't see what character you are talking about), I tend to say that it is not an ABAP but a DB problem.

But maybe one other thing: ABAP supports UCS-2 characters only, that is UTF16 without surrogates. Is the character in question a surrogate?

Read only

0 Likes
1,317
Read only

0 Likes
1,317

-> seems to be a surrogate

(have to ask a DBI guy who is not in the office today)

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,317
(have to ask a DBI guy who is not in the office today)

I remember your hotline comment