Hello,
I think it is a question for Adriano :)
I test the following scenario of using EXECUTE STATEMENT:
1. I insert into WIN1251-BLOB the text of the following SQL:
insert into TBL_CS__WIN1251 (COL_BLOB) values (_utf8 'тут будут UTF8-символы')
'тут будут UTF8-символы' - it is a text with russian symbols - 'here will be UTF8-symbols'
Note that I defined _utf8 before this text.
Because I write this text into WIN1251-BLOB, this text will consist only of WIN1251-symbols (not UTF8 symbols).
2. I want to execute this stored SQL in EXECUTE BLOCK.
execute block as declare STMT varchar(256);
begin for select COL_BLOB from TBL_CS__WIN1251 into :STMT DO EXECUTE STATEMENT :STMT; end
When I do it, I get the error "malformed string"
--------- SCRIPT
delete from TBL_CS__WIN1251;
insert into TBL_CS__WIN1251 (COL_BLOB) values (_win1251 'insert into TBL_CS__WIN1251 (COL_BLOB) values (_utf8 ''тут будут UTF8-символы'')');
select COL_BLOB from TBL_CS__WIN1251;
execute block as declare STMT varchar(256);
begin for select COL_BLOB from TBL_CS__WIN1251 into :STMT DO EXECUTE STATEMENT :STMT; end
---------
--------
Question
Should "EXECUTE STATEMENT" process _utf8 introducers in executed SQL ?
--------
Just for fun, I made a little gif with a demonstration of this problem in a similar script.
I used another insert statement here.
insert into TBL_CS__WIN1251 (COL_BLOB) values (_utf8 'insert into TBL_CS__WIN1251 (COL_BLOB) values (_utf8 ''тут будут UTF8-символы'')');
This change does not matter.
Regards,
Dmitry Kovalenko