千家信息网

BCP utility in Sybase(Unix Env

发表于:2025-01-20 作者:千家信息网编辑
千家信息网最后更新 2025年01月20日,We can use below command for bcp out a table to *.dat file,$SYB_BIN/bcp hnwreport.dbo.TblHNWCustomer
千家信息网最后更新 2025年01月20日BCP utility in Sybase(Unix Env

We can use below command for bcp out a table to *.dat file,

$SYB_BIN/bcp hnwreport.dbo.TblHNWCustomer out ${SYB_DATA}/${TABLE}.prod.dat -I/opt/muni/HNWEnv/HNW_interfaces.txt -U hnwuser -P Lip0v123 -S STEP_PROD_NY_DS -t'|' -b 10000 -e${ERRFILE} -T -c

Please be vigilant that if you want to use self-defined interface file rather than default system interface, you have to use -I option and define interface file in place.

If you want to use bcp utility, you can export Sybase,

export SYBASE=/optware/aseclient1503x/ase155b/

$SYBASE/OCS-15_0/bin/bcp hnwreport.dbo.TblHNWCustomer out /opt/HNW/HNWFileAnalysis/HNWOutput/TEST.dat -I/opt/muni/HNWEnv/HNW_interfaces.txt -U hnwuser -P Lip0v123 -S STEP_PROD_NY_DS -t'|' -b 10000 -e${ERRFILE} -T -c

$SYBASE/OCS-15_0/bin/isql -I/opt/muni/HNWEnv/HNW_interfaces.txt -U hnwuser -P Lip0v123 -S STEP_PROD_NY_DS < /tmp/test.sql


0