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 SkipVought 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 Stored Procedure from Unix

Status
Not open for further replies.

Lawrence13

Programmer
Aug 10, 2005
1
0
0
AU
Hi,

I am new to Teradata and need to execute a Teradata Stored Procedure from a Unix server with the Teradata client installed. I was hoping to execute the script from a single command line entry and think I need to do it via BTEQ but am unsure of the syntax.

For Oracle I would write

sqlpus -s User/Password@DB @SCRIPT.sql

where SCRIPT.sql would contain the sql commands. In this case - call StoredProcedureName(arguments)

I need a similiar command for Teradata but don't know the correct syntax.

Thanks in advance,
Lawrence
 

This worked for me....


echo "sel * from dbc.dbcinfo;" | bteq "logon copid/user,password"


I guess you could substitute

"call sp1;"

for

"sel * from dbc.dbcinfo;"



 
I use the following command:

bteq .logon username, password < sql.scp > sql.log.

In the sql.scp, you call the store procedure

Hope it works for you
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top