Yaping's Weblog

August 30, 2008

Comments in SHELL scripts

Filed under: Oracle — Yaping @ 4:18 am
Tags:

Refer to http://www.ixora.com.au/newsletter/2000_08.htm#comments

 

[oracle@chen tmp]$ cat test.sh
$ORACLE_HOME/bin/sqlplus -s /nolog <<EOF
conn test/test
select count(*) from t1;
#truncate table t1;
select count(*) from t1;
exit
EOF
[oracle@cheney tmp]$ sh test.sh
Connected.

  COUNT(*)
———-
     16512


Table truncated.


  COUNT(*)
———-
         0

[oracle@chen tmp]$  

 

oops, the data was gone. Be careful of comment sql in scripts.

Advertisements

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: