Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

how can I execute shell command from sqlplus

447396Aug 1 2007 — edited Aug 1 2007
Hi,

Can you please give me an way out how the command below can be executed :

SQL> begin
2 !(k=`expr $k-1`);
3 end;
4 /
!(k=`expr $k-1`);
*
ERROR at line 2:
ORA-06550: line 2, column 1:
PLS-00103: Encountered the symbol "!" when expecting one of the following:
begin case declare exit for goto if loop mod null pragma
raise return select update while with <an identifier>
<a double-quoted delimited-identifier> <a bind variable> <<
close current delete fetch lock insert open rollback
savepoint set sql execute commit forall merge
<a single-quoted SQL string> pipe
<an alternatively-quoted SQL string>

With out a begin-end block it is working :
SQL> !k=2

SQL> !(k=`expr $k-1`)

SQL> !(echo $k)

Unix version :
HP-UX hwhpx013 B.11.23 U ia64 1189652653

Regards,
Koushik
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 29 2007
Added on Aug 1 2007
14 comments
727 views