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.

Storing a file in a SQL Server Database

2 posts in General Discussion (Chinese) Last posting was on 2006-08-23 07:59:24.0Z
Carlos Vallejo Posted on 2006-08-01 20:28:21.0Z
Sender: 329f.44cfb6be.1804289383@sybase.com
From: Carlos Vallejo
Newsgroups: sybase.public.chinese.powerbuilder.general
Subject: Storing a file in a SQL Server Database
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <44cfb76b.32a8.1681692777@sybase.com>
X-Original-NNTP-Posting-Host: 10.22.241.42
X-Original-Trace: 1 Aug 2006 13:19:55 -0700, 10.22.241.42
Lines: 11
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 1 Aug 2006 13:19:58 -0800, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 1 Aug 2006 13:28:21 -0700
X-Trace: forums-1-dub 1154464101 10.22.108.75 (1 Aug 2006 13:28:21 -0700)
X-Original-Trace: 1 Aug 2006 13:28:21 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.chinese.powerbuilder.general:85
Article PK: 104132

I'm trying to insert a file into a table of a SQL Server
Database. I use

UPDATEBLOB docs
SET docFile = :file
WHERE doc_id = :doc_id;

file is a blob variable.

But when I try to read this file; it only retrieves 32767
KB, what am I doing wrong?


hni Posted on 2006-08-23 07:59:24.0Z
From: "hni" <hni@sybase.com>
Newsgroups: sybase.public.chinese.powerbuilder.general
References: <44cfb76b.32a8.1681692777@sybase.com>
Subject: Re: Storing a file in a SQL Server Database
Lines: 37
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
X-Original-NNTP-Posting-Host: hni-desktop.sybase.com
Message-ID: <44ec086a@forums-2-dub>
X-Original-Trace: 23 Aug 2006 00:48:58 -0700, hni-desktop.sybase.com
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 23 Aug 2006 00:48:58 -0700, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 23 Aug 2006 00:59:24 -0700
X-Trace: forums-1-dub 1156319964 10.22.108.75 (23 Aug 2006 00:59:24 -0700)
X-Original-Trace: 23 Aug 2006 00:59:24 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.chinese.powerbuilder.general:96
Article PK: 104141

Could you try FileReadEx to read your file.
If your PB version does not include this function ,pls refer this example:
FileRead:

integer li_FileNum

string ls_Emp_Input

long ll_FLength

ll_FLength = FileLength64("C:\HR\EMP_DATA.TXT")

li_FileNum = FileOpen("C:\HR\EMP_DATA.TXT", &
LineMode!)

IF ll_FLength < 32767 THEN

FileRead(li_FileNum, ls_Emp_Input)

END IF

<Carlos Vallejo> wrote in message
news:44cfb76b.32a8.1681692777@sybase.com...
> I'm trying to insert a file into a table of a SQL Server
> Database. I use
>
> UPDATEBLOB docs
> SET docFile = :file
> WHERE doc_id = :doc_id;
>
> file is a blob variable.
>
> But when I try to read this file; it only retrieves 32767
> KB, what am I doing wrong?