- P Laceholder
- PowerBuilder
- Tuesday, 9 November 2021 08:16 AM UTC
Hello,
I am moving an old application from Powerbuilder 9.0.2 to Powerbuilder 2019 R3; part of the application collects pieces of RTF documents, and composes them together, into the Rich Text Editor.
In PB9 to achieve this we had queries using SELECTBLOB and then it gets inserted into the OLE object that handles the RTF.
In PB 2019 R3 we tried keeping the same functionality but the result is completely different: the SELECTBLOB gets absolutely no data.
SELECTBLOB text_column
INTO :lb_text /* blob containing the RTF text */
FROM table
WHERE ...
USING SQLCA;
// Now if I am to check the length of the text is always 0
MessageBox("Text Length", String(Len(lb_text)))
A solution I found was to use SELECT instead of SELECTBLOB and reading it into a String variable; while this seems to be doing the job, if the RTF contains images / is too long then it actually cuts off the data or doesn't display at all.
I tried profiling the SQL queries and I noticed a big difference:
/* PowerBuilder 9.0.2 Generated SQL Query */
SET TEXTSIZE 2147483647
SELECT text_column
FROM table
WHERE ...
/* PowerBuilder 2019 R3 Generated SQL Query */
declare @p1 int
set @p1=0
declare @p3 int
set @p3=229378
declare @p4 int
set @p4=294916
declare @p5 int
set @p5=0
exec sp_cursoropen @p1 output,N'select text_column from table ...',@p3 output,@p4 output,@p5 output
select @p1, @p3, @p4, @p5
While the code inside PB is the same on both sides, the latter doesn't retrieve any data (the blob has len 0).
How should I approach / fix this issue?
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.