Sybase IQ : Loading a table from a remote server
Please note: Until recently, the only way to load a table in Sybase IQ was to have the data
file(s) reside on the same host machine as the database process. Now, superior load performance
can be attained from a remote machine (a separate host machine on your network).
In ASE and Oracle, most developers are used to using BCP or SQL-Loader.
For Sybase IQ, the optimal way to load a table from a remote server is via the dbisql utility,
and the "load table" command.
Load Table : Where the file does not reside on the database server
- a bit slower than normal "load table"
- requires use of JDBC connection, or DBISQL (no TDS)
- need this setting: set option public.allow_read_client_file = 'on'
- need this grant: grant READCLIENTFILE to dbuser
- need this clause in LOAD statement: using client file
Sample snippet to add to load table SQL:
using client file
'/home/jsmith/ccr2.dat'
Below is a conventional load table statement.
LOAD TABLE MYDB.v_invoice (
invoice_id ,
invoice_key,
invoice_cd ,
status_cd ,
restricted_ind ,
country_id ,
cust_id
)
from '/app/sybase/data/invoice/data/vc.dat'
quotes off
escapes off
delimited by '|'
row delimited by '\x0a'
notify 1000
on file error continue
with checkpoint on
go
commit
go
|
|