on 2015 Jun 10 2:59 PM
I can't get a result set when using hexadecimal escapes in a parameterized query versus a straight SQL query.
Examples from log (so you can see what the server is seeing):
Without a parameter (results returned as expected):
+2,<,289,PREPARE,SELECT PROD_CODE FROM PRODUCTS WHERE INFO = 't\\x00e\\x00c\\x00h'
Using a parameter, apparently identical to hard-coded value above (no results returned):
=,<,289,PREPARE,SELECT PROD_CODE FROM PRODUCTS WHERE INFO = ?
+1,H,289,0,varchar,'t\\x00e\\x00c\\x00h'
Is it not possible to do this using parameters?
Fyi, the reason behind this approach is to find some data stored as Unicode inside a long varchar field.
Using SQL Anywhere 12.0.1.3994, Delphi XE
Update: Code Example (Object Pascal)
qryNoParams.SQL.Text := 'SELECT PROD_CODE FROM PRODUCTS WHERE INFO = ' + QuotedStr('t\\x00e\\x00c\\x00h');
qryNoParams.Open; {expected result set returned}
qryParams.SQL.Text := 'SELECT PROD_CODE FROM PRODUCTS WHERE INFO = :INFO';
qryParams.ParamByName('INFO').AsString := 't\\x00e\\x00c\\x00h';
qryParams.Open; {no result set}
Request clarification before answering.
User | Count |
---|---|
76 | |
30 | |
10 | |
8 | |
8 | |
7 | |
7 | |
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.