Stored Procedure not executing


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Stored Procedure not executing
# 1  
Old 04-25-2013
Stored Procedure not executing

Code:
 
 
  below code is not executing  the stored procedure,not sure what the issue.Even sqllog is blank.please help me its very urgent.
sqlplus -s $connect_str@$DB_ORACLE_SID >> ${SQL_LOG_FILE} << EOF
set serverout on
set feed off
set head off
set pages 0
set colsep ,
set tab off
set lin 150
WHENEVER SQLERROR EXIT 9
SPOOL ${SQL_LOG_FILE}
set timing on
DECLARE 
v_view_name VARCHAR2(100):='callcenter_reporting_test_proc';
v_day number(5):='3'; 
begin
dbms_output.put_line('Purging partition for table '|| v_table_name);
dbms_output.put_line('Purging partition for table '|| v_table_name||' Purging Days'|| v_ret_days);
MBSSMGR.Daily_Purge_Partitions(v_view_name,v_day);
COMMIT; 
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line( SQLCODE || '-' || SQLERRM);
end;
/
SPOOL OFF 
EOF`

# 2  
Old 04-25-2013
How do you know that your Stored Procedure is not executing? Are you getting any errors or warnings?

Also is it programmed to return any results if ran successfully?

Try calling it from SQL*Plus and check the results:
Code:
SQL> CALL MBSSMGR.Daily_Purge_Partitions('callcenter_reporting_test_proc','3');

# 3  
Old 04-25-2013
Quote:
please help me its very urgent
Please read the forum rules.
# 4  
Old 04-26-2013
i didn't find the v_table_name and v_ret_days in the dbms_output.

---------- Post updated at 02:29 AM ---------- Previous update was at 02:28 AM ----------

Can run the manually for the Daily_Purge_Partitions proc

---------- Post updated at 02:42 AM ---------- Previous update was at 02:29 AM ----------

i tried with sample it's working for me. Can you try like

Code:
 #!/bin/sh
export ORACLE_SID=DEXTER
export ORACLE_HOME=/opt/oracle/11g/
export PATH=$PATH:/opt/oracle/11g/bin
SQL_LOG_FILE='/home/oracle/test.txt'
echo $SQL_LOG_FILE
ext_sta=`sqlplus -s training1/training1@orcl <<eof
set serverout on
set feed off
set head off
set pages 0
set colsep ,
set tab off
set line 150
WHENEVER SQLERROR EXIT 9
SPOOL $SQL_LOG_FILE
set timing on
DECLARE 
v_view_name VARCHAR2(100):='proc1';
v_day number(5):='3'; 
begin
dbms_output.put_line('Purging partition for table');
proc1;
COMMIT; 
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line( SQLCODE || '-' || SQLERRM);
end;
/
SPOOL OFF 
EOF`

Let me know
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to KIll a Stored procedure invoked by UNIX?

Hi, I am using sql server 2008 version and invoking the stored procedure using unix script. I want to know the procedure of killing the stored procedure in sql server. If I kill -9 the unix script will it also terminate the process at the SQL server. When I executed the kill -9 PID in unix... (2 Replies)
Discussion started by: Rahul Raj
2 Replies

2. Shell Programming and Scripting

How to call a stored procedure from shell program?

How to call a stored procedure from shell program (1 Reply)
Discussion started by: noorm
1 Replies

3. UNIX for Dummies Questions & Answers

Calling stored procedure from unix

Hi, My stored procedure returns a value. How to retrieve the value and display in unix. Stored procedure CREATE OR REPLACE PROCEDURE gohan(num INT) IS BEGIN DBMS_OUTPUT.PUT_LINE('My lucky number is ' || num); END; Unix Scripting i used sqlplus -s... (7 Replies)
Discussion started by: gohan3376
7 Replies

4. Programming

Help with pl/sql stored procedure

Hi, Can anyone please let me know where to check if a particular stored procedure exists. If the procedure exists I want to display some message and if the procedure does not exists i want to exit with error message. checking from dba_objects doesnt help. suprisingly the procedure i... (3 Replies)
Discussion started by: justchill
3 Replies

5. Programming

How to call sqlloader from stored procedure!!! Advise

Hi , I have a dellimited .dat file and a sqlloader. I want to call the sqlloader from a oracle stored procedure. The procedure should return the result of sqlloader's execution. (3 Replies)
Discussion started by: Haque123
3 Replies

6. Shell Programming and Scripting

need to call 3 stored procedure at the same time

Hi GUYS, I need to trigger 3 stored procedure at the same time.. I know how to trigger the stored procedure. If anybody can tell me how to trigger 3 different process at the same time parallelly.. that would be helpful.. Thanks for your help in advance, Magesh (1 Reply)
Discussion started by: mac4rfree
1 Replies

7. Shell Programming and Scripting

Calling MYSQL Stored Procedure?

Hi, Can anyone help me with the correct syntax to call a MYSQL stored procedure from a shell script. I have tried the following, (no input params): /usr/bin/mysql -uadmin -ppassword call TL_CLENSEDATA(); resulting in error: /home/hosting/data/scripts/dbclense.sh: line 12: syntax error... (3 Replies)
Discussion started by: kshelluser
3 Replies

8. Shell Programming and Scripting

Stored Procedure on NT/SQLServer

Hi: How will I execute a Stored Procedure that sits on NT/SQLServer. Any help would be appreciated. Thanks (3 Replies)
Discussion started by: mayohan
3 Replies

9. Shell Programming and Scripting

Shell arrays in oracle stored procedure

Is it possible to pass unix shell arrays in Oracle stored procedure? Is yes, how? Thanks (6 Replies)
Discussion started by: superprogrammer
6 Replies

10. UNIX for Advanced & Expert Users

Oracle stored procedure.

I am using sqlplus. I have the stored procedure name. How can i print the stored procedure content? (2 Replies)
Discussion started by: kamil
2 Replies
Login or Register to Ask a Question