Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Please Help to Truncate a table!!!

Status
Not open for further replies.

vm17737

Programmer
Dec 19, 2002
3
US
I need to truncate, not drop, a Sybase table from a UNIX shell script.
Is there a special sytax for embaded SQL?
Thanks in advance!
 
No, this is pretty easy....

#!/usr/bin/ksh -p

PATH_TO_ISQL

${PATH_TO_ISQL}/isql -SSYBASE -U${ADMINNAME} -P${PASSWORD} <<-EOF
truncate table ${DB_NAME}..${TABLE_NAME}
GO
EOF

Whatever else you need to do here.....
 
Hi
U can use the ISQL command at unix prompt
isql -Sservername -Uusername -Ppasword -iinputfile -ooutputfile
in the inputfile u can specify your sql commands
after each command give a go statement

u can trap the output by using the -o switch
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top