|
|
| Peter_reed@hotmail.com 2007-03-09, 8:08 am |
| I am using PB 10.0 and accessing a DB2 table to retrieve one field
(Varchar), the field is unicode.
If I use the blob field as the receiving field from my fetch stmt I
don't seem to get anything returned (the length is 0). So I tried
using a string field to receive the data and then convert it to a
blob, but the string field only contains 36 characters even though the
field I am retrieving is longer (60). Also putting the resultant blob
through the unicode converter returns an error (failed to find a match
for character), so it sounds as though the convert string to blob
didn't really work either.
Any ideas anyone?
(I originally had a normal selectblob stmt to access the table which
worked ok, but the sys progs upstairs said that this was in-efficient
for DB2 and I needed to use the frustrating and vague, declare,
prepare, open and fetch method to retrieve the data (thanks IBM)
unfortunately I can't use selectblob for DB2 so I have to use a normal
select stmt).
| |
| Peter_reed@hotmail.com 2007-03-09, 8:08 am |
| Slight correction - when I fetch the data into a blob field the length
comes out as 195688489...
| |
| Peter_reed@hotmail.com 2007-03-13, 8:34 am |
| Well thanks for all the replys this site has been really
helpful.......here is the solution
DECLARE MY_Cursor DYNAMIC CURSOR FOR SQLSA;
Prepare SQLSA from "Select hex(LENGTH(TEXT_LINE))||TEXT_LINE from
DB2table where br_no = ? and cust = ?" Using DBabc;
OPEN DYNAMIC MY_Cursor USING :ls_br_no,:ls_Cust_No;
FETCH MY_Cursor into :lbl_Unicode;
Close MY_Cursor
The blob was a 74 byte field whereas the VARCHAR in DB2 was 70 bytes,
I then converted the blob to a string, truncated THREE bytes off the
front and then
converted it back to a blob(70 long), this acheived the desired
result.
What a pain in the proverbial this is, I now have to work out how to
do a dynamic select where a field can be either 1 or 3, once again it
is not simple like a static call is.
| |
| Philip & Elena Salgannik 2007-03-13, 10:09 pm |
|
<Peter_reed@hotmail.com> wrote in message
news:1173788114.040785.324760@8g2000cwh.googlegroups.com...
> Well thanks for all the replys this site has been really
> helpful.....
This group has been essentially dead for a number of years.
forums.sybase.com hosts a bunch of active PB related groups...
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|