dbTalk Databases Forums  

insert/read image

comp.databases.sybase comp.databases.sybase


Discuss insert/read image in the comp.databases.sybase forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Sam
 
Posts: n/a

Default insert/read image - 08-27-2004 , 09:12 AM






Hello
I've got some trouble with image column under sybase 11.9.x and dblib

I have : create table test(id int, blob IMAGE);
and INSERT INTO test VALUES(1, NULL);

First, if I try to write blob column with dbwritetext
something like:
....
dbcmd(..., "SELECT blob FROM test WHERE id=1");
dbwritetext(....); // send to me erro : msg 156,
level 15, ... "incorrect syntax near the keywork NULL"

So is it possible to write an image column which is NULL. ??


Finally I succeed in changing my "INSERT ... NULL" to INSERT INTO test
VALUES(1, 0x00);
and I write 2mo in my blob...

cool
But if I try now to re-read my image column with dbreadtext()
I just read ONLY the first 32768 bytes.

Sybase documentation says "An application that retrieves image values larger
than 32768 bytes will need to call dbsetopt..."
Right but How can I set DBTEXTSIZE if I don't know the real size of my blob
column I wanna read ??


Could you help me guys ??


anyway thanx...





Reply With Quote
  #2  
Old   
Michael Peppler
 
Posts: n/a

Default Re: insert/read image - 08-27-2004 , 02:00 PM






On Fri, 27 Aug 2004 16:12:48 +0200, Sam wrote:

Quote:
But if I try now to re-read my image column with dbreadtext()
I just read ONLY the first 32768 bytes.

Sybase documentation says "An application that retrieves image values larger
than 32768 bytes will need to call dbsetopt..."
Right but How can I set DBTEXTSIZE if I don't know the real size of my blob
column I wanna read ??
You can get that information via a "select datalength(image_col)", or just
set it to the largest possible value that you might retrieve.

Michael
--
Michael Peppler Data Migrations, Inc.
mpeppler (AT) peppler (DOT) org http://www.peppler.org/
Sybase T-SQL/OpenClient/OpenServer/C/Perl developer available for short or
long term contract positions - http://www.peppler.org/resume.html



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.