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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to execute procedure from unix command line 2

Status
Not open for further replies.

marrow

Technical User
Jul 20, 2001
425
US
In oracle9, I have compiled oracle procedure "CREATE OR REPLACE EXTRACT_FILE1 AS ...."
I can run OK if
sqlplus /nolog
>connect user1/user1@database1
>execute EXTRACT_FILE1

But not sure how to use short form...
Can I initiate the execute from unix on single line?
sqlplus user1/user1@database1 .....?????
 

You need to put the "execute EXTRACT_FILE1..." in an sql script file. [3eyes]

echo "execute EXTRACT_FILE1;" > mysql.sql
echo "exit" >>mysql.sql
sqlplus user1/user1@database1 @mysql.sql




----------------------------------------------------------------------------
The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb
 
Or pass the command to sqlplus via pipe:
Code:
echo 'execute extract_file' |sqlplus usr/passwd
Have a look at faq186-2220 for a more detailed description.

Stefan
 
Thanks Stefanhei & LKB, works a treat.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top