Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: stored procedure giving different result vs SAME Select statement



Permlink Replies: 1 - Last Post: Jul 11, 2017 4:16 PM Last Post By: Joe Sansalone Threads: [ Previous | Next ]
Joe Sansalone

Posts: 158
Registered: 1/15/06
stored procedure giving different result vs SAME Select statement
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 11, 2017 2:34 PM
SOLVED:

With stored proc, get BLOB as Bytes and convert to a string.
xml := TEncoding.UTF8.GetString(FStoredProc.ParamByName('xml').AsBytes;


Hi,

I have a table with a Text BLOB field.
The database is UTF8.
I connect via IBX with UTF8 and SQLDialect 3.

If I use a TIBSQL and simply execute the Select statement to return the Text BLOB (.asString),
I get the correct string.

However, if I create a stored procedure with the exact same select, and use a TIBStoredProc
to retrieve the Text BLOB (.asString), I get strange characters. It's like it's translating to UTF8 twice or something.

I noticed that the stored procedure metadata has the output type listed as
BLOB SUB_TYPE TEXT SEGMENT SIZE 4000 CHARACTER SET UTF8.

Help

Joe

Edited by: Joe Sansalone on Jul 11, 2017 4:15 PM
Joe Sansalone

Posts: 158
Registered: 1/15/06
Re: stored procedure giving different result vs SAME Select statement
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 11, 2017 3:19 PM   in response to: Joe Sansalone in response to: Joe Sansalone
SOLVED:

With stored proc, get BLOB as Bytes and convert to a string.

xml := TEncoding.UTF8.GetString(FStoredProc.ParamByName('xml').AsBytes;

Joe

Joe Sansalone wrote:
Hi,

I have a table with a Text BLOB field.
The database is UTF8.
I connect via IBX with UTF8 and SQLDialect 3.

If I use a TIBSQL and simply execute the Select statement to return the Text BLOB (.asString),
I get the correct string.

However, if I create a stored procedure with the exact same select, and use a TIBStoredProc
to retrieve the Text BLOB (.asString), I get strange characters. It's like it's translating to UTF8 twice or something.

I noticed that the stored procedure metadata has the output type listed as
BLOB SUB_TYPE TEXT SEGMENT SIZE 4000 CHARACTER SET UTF8.

Help

Joe
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02