execute store procedure


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers execute store procedure
# 1  
Old 05-10-2006
execute store procedure

Hi, can someone point out the tutorial or syntax for how to execute store procedure through shell scripting .

thanks.
# 2  
Old 05-10-2006
Quote:
Originally Posted by epall
Hi, can someone point out the tutorial or syntax for how to execute store procedure through shell scripting .

thanks.
You want to execute Database Stored Procedure?
# 3  
Old 05-10-2006
Yes

can help .
# 4  
Old 05-11-2006
Quote:
Originally Posted by epall
can help .
There are numerous ways.. you can create a SQL script and call from shell using sqlplus -s user/pwd @sqlscript..

Elaborate your requirement..
# 5  
Old 05-12-2006
wondering

Below is my script. I calling PS/SQL named:dummy_select. I dun know what's wrong of it...Getting error : wrong argument type.

function checkFileStatus
{

sqlplus -S $USER/$PASS@$DB << EOF
exec dummy_select('$1');
commit;
quit;
EOF

}


-----dummy PS/SQL--
CREATE OR REPLACE PROCEDURE dummy_select(
v_file_name VARCHAR2,
dummy_select_cv IN OUT Cv_Types.customer_tp)
IS
BEGIN

OPEN dummy_select_cv FOR

SELECT sysdate FROM dual;

END;
/
# 6  
Old 05-12-2006
shell variables wont work inside the DB.
if am i right.
# 7  
Old 05-12-2006
Quote:
Originally Posted by epall
Below is my script. I calling PS/SQL named:dummy_select. I dun know what's wrong of it...Getting error : wrong argument type.

function checkFileStatus
{

sqlplus -S $USER/$PASS@$DB << EOF
exec dummy_select('$1');
commit;
quit;
EOF

}


-----dummy PS/SQL--
CREATE OR REPLACE PROCEDURE dummy_select(
v_file_name VARCHAR2,
dummy_select_cv IN OUT Cv_Types.customer_tp)
IS
BEGIN

OPEN dummy_select_cv FOR

SELECT sysdate FROM dual;

END;
/
Make sure that you can run the SQL statement that you're passing through shell.. as you have an IN OUT parameter in your PL/SQL.. so you need to pass that in the SQL statement as well..
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Why i can't execute the procedure in shell script?

i have the following code inside a shell script .prog in oracle server when i call the program DBMS_OUTPUT.PUT_LINE(x_return_status|| ln_rep_req_id); will return 0 , it is very strange , i try to submit the concurrent request in oracle , and it can successfully executed, what am i missing ? i... (1 Reply)
Discussion started by: feilhk
1 Replies

2. Shell Programming and Scripting

Unable to execute Stored Procedure from CRON

Hi, I am very new to this environment - I hope this is the right platform to discuss my issue: I created a CRON job to run a Stored Procedure from our database - Sybase. Within the Stored Procedure there is a TRUNCATE table and CREATE table function. the CRON job fails to run with... (2 Replies)
Discussion started by: pizzazzz
2 Replies

3. Shell Programming and Scripting

Execute a shell script from Oracle procedure

Hi Gurus, Want to execute a shell script from a oracle procedure and get the status of the same, any assistance in this regard will be appreciated. proc_data.sh is script name which I want to execute from oracle procedure It should work something like below procedure test begin... (1 Reply)
Discussion started by: palanisvr
1 Replies

4. Shell Programming and Scripting

Execute stored procedure through script in sybase database and store the output in a .csv file

Hi, I have a sybase stored procedure which takes two input parameters (start_date and end_date) and when it get executed, it gives few records as an output. I want to write a unix script (ksh) which login to the sybase database, then execute this stored procedure (takes the input parameter as... (8 Replies)
Discussion started by: amit.mathur08
8 Replies

5. Shell Programming and Scripting

Shell Linux to connect to a database and execute store procedure

HI, i want to write a script (Linux) that: 1) connect to a database oracle 2) execute some store procedure. Can anybody help me, please? Thanks a lot Andrew (3 Replies)
Discussion started by: manichino74
3 Replies

6. Shell Programming and Scripting

Error in calling store procedure using SQLPLUS in unix

Hi, I am facing the following error in calling the stored procedure from SQLPLUS in unix environment. SQL> set serveroutput on SQL> var store number; SQL> exec test_proc(:store, 200); BEGIN TEST_PROC(:store, 200); END; * ERROR at line 1: ORA-01858: a non-numeric character was found... (8 Replies)
Discussion started by: pradeep7986
8 Replies

7. Shell Programming and Scripting

How to execute the stored procedure from shell script

How to execute the stored procedure from shell script and is there any possibility to print the dbms output in a log file. (2 Replies)
Discussion started by: dineshmurs
2 Replies

8. Shell Programming and Scripting

how to store the return values of stored procedure in unix shell script.

hi i am calling a oracle stored procedure(in the database) from unix shell scripting (a.sh). the called stored procedure returns some values through OUT variables i want to assign the return values of stored procedure in to unix shell script variable. can you provide me the code. ... (1 Reply)
Discussion started by: barani75
1 Replies

9. Shell Programming and Scripting

How to execute an Oracle procedure using shell

Hi , i have created an .sh file that has the following code: #!/bin/ksh sqlplus -s p1istuat/p1istuat@CWS_IST6 @Procedure_Execute.sql & sqlplus -s p1istuat/p1istuat@CWS_IST6 << EOF exit EOF The mentioned Procedure_Execute.sql file inside has the following code: exec TEST; ... (5 Replies)
Discussion started by: vins_san
5 Replies

10. Shell Programming and Scripting

run shell script from oracle store procedure

hi, this is urgent..can i run a shell script from store procedure without using java. (8 Replies)
Discussion started by: arnabb4u
8 Replies
Login or Register to Ask a Question