dbTalk Databases Forums  

Efficiently Load/Bulk Insert LONG BINARY data

sybase.public.sqlanywhere.general sybase.public.sqlanywhere.general


Discuss Efficiently Load/Bulk Insert LONG BINARY data in the sybase.public.sqlanywhere.general forum.



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

Default Efficiently Load/Bulk Insert LONG BINARY data - 12-24-2009 , 02:28 PM






Hi,

We need to bulk insert a lot of records into a table. The
table contains a lot of LONG BINARY fields. Usually I can
use the LOAD statement, but in this case the problem I have
is that I have to represent bytes in LONG BINARY as hexical
and that is quite verbose. Is there any way to efficiently
represent binary data in a file that can be subsequently
LOADed into the db?

Thanks

Reply With Quote
  #2  
Old   
Jeff Albion [Sybase iAnywhere]
 
Posts: n/a

Default Re: Efficiently Load/Bulk Insert LONG BINARY data - 12-24-2009 , 02:51 PM






Hi Irving,

If you have each field as an individual file on the server file system,
you can use the "xp_read_file()" system stored procedure:

http://dcx.sybase.com/index.php#1101...s-4354279.html

If you have each field stored separately as an individual file on the
client's file system and are using v11, you can use the READ_CLIENT_FILE
function:

http://dcx.sybase.com/index.php#1101...ient-file.html

Regards,

On 12/24/2009 2:28 PM, Irving Zhu wrote:
Quote:
We need to bulk insert a lot of records into a table. The
table contains a lot of LONG BINARY fields. Usually I can
use the LOAD statement, but in this case the problem I have
is that I have to represent bytes in LONG BINARY as hexical
and that is quite verbose. Is there any way to efficiently
represent binary data in a file that can be subsequently
LOADed into the db?
--
Jeff Albion, Sybase iAnywhere

iAnywhere Developer Community :
http://www.sybase.com/developer/libr...ere-techcorner
iAnywhere Documentation : http://www.ianywhere.com/developer/product_manuals
SQL Anywhere Patches and EBFs :
http://downloads.sybase.com/swd/summ...&timeframe =0
Report a Bug/Open a Case : http://case-express.sybase.com/cx/

Reply With Quote
  #3  
Old   
Irving Zhu
 
Posts: n/a

Default Re: Efficiently Load/Bulk Insert LONG BINARY data - 12-24-2009 , 11:38 PM



Hi Jeff,

Is it possible that I generate a big file that contains all
the data, i.e. all the records and all the fields of each
record are contained in a single file?

The reason is I control the generation of the load file. One
file is probably more efficient than multiple files.

Thanks,
Irving

Quote:
Hi Irving,

If you have each field as an individual file on the server
file system, you can use the "xp_read_file()" system
stored procedure:


http://dcx.sybase.com/index.php#1101...s-4354279.html

If you have each field stored separately as an individual
file on the client's file system and are using v11, you
can use the READ_CLIENT_FILE function:


http://dcx.sybase.com/index.php#1101...ient-file.html

Regards,

On 12/24/2009 2:28 PM, Irving Zhu wrote:
We need to bulk insert a lot of records into a table.
The table contains a lot of LONG BINARY fields. Usually
I can use the LOAD statement, but in this case the
problem I have is that I have to represent bytes in LONG
BINARY as hexical and that is quite verbose. Is there
any way to efficiently represent binary data in a file
that can be subsequently LOADed into the db?

--
Jeff Albion, Sybase iAnywhere

iAnywhere Developer Community :

http://www.sybase.com/developer/libr...ere-techcorner
iAnywhere Documentation :
http://www.ianywhere.com/developer/product_manuals SQL
Anywhere Patches and EBFs :

http://downloads.sybase.com/swd/summ...&timeframe =0
Report a Bug/Open a Case :
http://case-express.sybase.com/cx/

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.