Home > Archive > SQL Anywhere ultralite > May 2005 > Re: blob









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: blob
Dave Mawer

2005-05-11, 8:23 pm

I have got code that can do that.

Firstly you set up your database with a field as LONG BINARY.

If you are using the C++ API you can do the following

// get the size of the BLOB - l_size is the file_size
rp_byte *p_data = ( rp_byte* ) MemGluePtrNew ( l_size );

// read the file
len = (rp_length) FileRead ( i_handle, p_data, l_size, 1, &err );

// set up the ULValue wrapper class to hold the data
ULValue binaryData;
// set the data
// the mem_puc_table is a table* to the table in your database
// the arg_i_table_is is the ul_column_id of the column -> the LONG BINARY
field
binaryData.SetBinary ( p_data, l_size );
mem_puc_table->Set ( arg_i_table_id, binaryData );

MemPtrFree ( p_data );
p_data = NULL;

"Greg Fenton" <greg. fenton_NOSPAM_@ianyw
here.com> wrote in message
news:423adf1b$1@foru
ms-1-dub...
> omri wrote:
>
>
> How about the other question I asked:
>
>
> greg.fenton
> --
> Greg Fenton
> Consultant, Solution Services, iAnywhere Solutions
> --------
> Visit the iAnywhere Solutions Developer Community
> Whitepapers, TechDocs, Downloads
> http://www.ianywhere.com/developer/



Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com