Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Save and retrieve a pdf file in ASA database

2 posts in ,  Database Powerscript Last posting was on 2009-09-10 15:44:12.0Z
mgkistler Posted on 2009-09-10 15:03:58.0Z
From: mgkistler <mgkistler@gmail.com>
Newsgroups: sybase.public.powerbuilder.powerscript,sybase.public.powerbuilder.database
Subject: Save and retrieve a pdf file in ASA database
Date: Thu, 10 Sep 2009 08:03:58 -0700 (PDT)
Organization: http://groups.google.com
Lines: 11
Message-ID: <97cec042-eb45-45c5-a4c5-853da4f03e73@13g2000prl.googlegroups.com>
NNTP-Posting-Host: 12.15.7.30
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
X-Trace: posting.google.com 1252595039 10508 127.0.0.1 (10 Sep 2009 15:03:59 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Thu, 10 Sep 2009 15:03:59 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: 13g2000prl.googlegroups.com; posting-host=12.15.7.30; posting-account=P_Q2NAoAAAA39GWgtM79lgP3aXl0QeHY
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; InfoPath.1; .NET CLR 1.1.4322),gzip(gfe),gzip(gfe)
Path: forums-1-dub!forums-master!newssvr.sybase.com!news-sj-1.sprintlink.net!news-peer1.sprintlink.net!newsfeed.yul.equant.net!news-out.readnews.com!transit4.readnews.com!postnews.google.com!13g2000prl.googlegroups.com!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.powerscript:27052 sybase.public.powerbuilder.database:30284
Article PK: 322385

I am trying to save an externally created pdf file in our database and
retrieve/display it when the user requests it. I am reading the file
into a blob (streammode) and saving the blob using UPDATEBLOB. This is
working - the info is evidently saved in hex format.

When I retrieve it using SELECTBLOB, I have not found a way to write
it back out to a file for display. Writing the blob (streammode) just
writes it out as hex. Converting to strings using EncodingANSI! or
EncodingUTF16LE! does not work.

What am I missing?


Chris Werner Posted on 2009-09-10 15:44:12.0Z
From: "Chris Werner" <cwAT{PleaseNoSpam}f-s.de>
Newsgroups: sybase.public.powerbuilder.powerscript,sybase.public.powerbuilder.database
References: <97cec042-eb45-45c5-a4c5-853da4f03e73@13g2000prl.googlegroups.com>
Subject: Re: Save and retrieve a pdf file in ASA database
Lines: 35
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5843
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4aa91ecc$1@forums-1-dub>
Date: 10 Sep 2009 08:44:12 -0700
X-Trace: forums-1-dub 1252597452 10.22.241.152 (10 Sep 2009 08:44:12 -0700)
X-Original-Trace: 10 Sep 2009 08:44:12 -0700, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.powerscript:27053 sybase.public.powerbuilder.database:30285
Article PK: 322384

What is the datatype of the column where you store the PDF in?
I believe that should be LONG BINARY.

What do you mean with "hex format"? If you see hexadecimal
numbers that should be only a represantation of the binary data.

Have you checked if the length of the blob stored into the database
using UPDATEBLOB is the same as the length of the data you've
retrieved using SELECTBLOB and the same as the original file
size (get that using PB function FileSize). If that fails you may have
read or stored only part of the data. Try FileReadEx and FileWriteEx
in that case.

HTH

Chris Werner
f+s software gmbh



"mgkistler" <mgkistler@gmail.com> schrieb im Newsbeitrag
news:97cec042-eb45-45c5-a4c5-853da4f03e73@13g2000prl.googlegroups.com...

>I am trying to save an externally created pdf file in our database and
> retrieve/display it when the user requests it. I am reading the file
> into a blob (streammode) and saving the blob using UPDATEBLOB. This is
> working - the info is evidently saved in hex format.
>
> When I retrieve it using SELECTBLOB, I have not found a way to write
> it back out to a file for display. Writing the blob (streammode) just
> writes it out as hex. Converting to strings using EncodingANSI! or
> EncodingUTF16LE! does not work.
>
> What am I missing?