Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

PB 10 and Fileopen

171 views
Skip to first unread message

Bergy

unread,
Nov 17, 2005, 9:23:17 AM11/17/05
to
I am in the process of upgrading a application to Powerbuilder 10.2.1.9004
from Powerbuilder 9.0.3.8546. After the migration it seems that the
fileopen does not allow me to write a blob to the file. Has anyone had
similar problems
with updateing powerbuilder? Below is the code that was working in PB 9

IF isnull (as_pathname) THEN return -1
IF isnull (abl_blob) THEN return -1
IF as_pathname = "" THEN return -1

li_FileNum = FileOpen(as_pathname, StreamMode!, Write!, LockWrite!,
Replace!)
IF li_FileNum = -1 THEN return -2
IF isnull (li_filenum) THEN return -2

ll_len = Len (abl_blob)
ll_pos = 1 //position on the blob
DO WHILE ll_len > 0
lbl_temp = BlobMid (abl_blob, ll_pos, 32765)
li_return = FileWrite (li_FileNum, lbl_temp)
IF IsNull (li_return) THEN return -3 //error happens
IF li_return = -1 THEN return -3 //error happens
ll_len = ll_len - li_return
ll_pos = ll_pos + li_return
LOOP

li_return = FileClose (li_fileNum)
IF IsNull (li_return) THEN return -4 //error happens
IF li_return = -1 THEN return -4 //error happens

return 1

Bergy

unread,
Nov 22, 2005, 2:18:23 PM11/22/05
to
OK, this is not a problem with fileopen but selectblob.

I am using:

Sybase ASE 12.5.1 build 1823(EBF 11426).

HP9000-879 (64-bit)

HP-UX 11.0

I have done some experimenting from version 9 to 10 and notice that the blob
length is double the size in 10.

In PB 9 ll_len = 244

In PB 10 ll_len = 488

Any help would be appreciated.

Terry Voth

unread,
Nov 22, 2005, 3:13:09 PM11/22/05
to
The double length screams ANSI vs. Unicode, but SELECTBLOB and BlobLen()
shouldn't have these issues. Can you show us the code snippet that does the
test, and mention the data type being used on the back end?

Let us know,

Terry [TeamSybase] and Sequel the techno-kitten

On 22 Nov 2005 11:18:23 -0800,
in sybase.public.powerbuilder.general


*********************************
Click once a day to help the hungry
http://www.thehungersite.com
*********************************
User Manual
===========
TeamSybase <> Sybase employee
Forums = Peer-to-peer
Forums <> Communication with Sybase
IsNull (AnswerTo (Posting)) can return TRUE
Forums.Moderated = TRUE, so behave or be deleted
*********************************

Sequel's Sandbox: http://www.techno-kitten.com
Home of PBL Peeper, a free PowerBuilder Developer's Toolkit.
Version 3.0.02 now available at the Sandbox
PB Futures updated Nov 14/2005
See the PB Troubleshooting & Migration Guides at the Sandbox
^ ^
o o
=*=

Bergy

unread,
Nov 22, 2005, 4:22:27 PM11/22/05
to
Terry,
In my first post I included the code for the function
f_makefilefromblob. I call this function and pass the pathname and blob by
value to the function. The data type on ASE is "text". I am geting the
length by ll_len = Len (abl_blob). What I am trying to retrieve and save to
a file is a BMP image.


"Terry Voth" <seq...@techno-kitten.com> wrote in message
news:43837bd5$1@forums-1-dub...

Bergy

unread,
Nov 23, 2005, 5:31:59 PM11/23/05
to
I am not sure where to post this but I think I have figure out the problem.
When I selectblob from ASE and the column datatype is TEXT it does not work.
But if I convert the column datatype to IMAGE then it works and I do not
have to edit any code. This is also true if I am retrieving a RTF file
stored in a TEXT datatype. I did not see a good way in powerbuilder to
convert the blob to a useable format. I tried using the following but did
not seem to work. Any suggestions would be helpful.

ls_temp = string (abl_blob,EncodingANSI! )

"Terry Voth" <seq...@techno-kitten.com> wrote in message
news:43837bd5$1@forums-1-dub...

0 new messages