Forum Stats

  • 3,734,278 Users
  • 2,246,936 Discussions
  • 7,857,217 Comments

Discussions

arguments to sql script

608465
608465 Member Posts: 66
edited Sep 11, 2008 8:57AM in General Database Discussions
Hi all,
I am creating a shell script savetest.sh . In that shell script I am running an .sql script.I want to receive some arguments in sql script which I am passing as shell arguments.How to achieve that? what is the syntax for it?

Savetest.sh

#!/bin/ksh
. /export/home/oracle/.profile
sqlplus $1/$1 << EOF1
whenever sqlerror exit 1
prompt Saving before changes......
@genCreateSourceTypes.sql $1 $2;
whenever sqlerror exit 1
COMMIT;
EXIT 0
EOF1

in sql script
USER varchar2(20)=&&1;
NAME varchar2(20)=&&2;

is it the righ syntax? please help.
Tagged:

Answers

This discussion has been closed.