Unable to execute Stored Procedure from CRON


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Unable to execute Stored Procedure from CRON
# 1  
Old 03-05-2012
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 Msg 226 saying TRUNCATE not allowed within a multi-statement transaction - as well as the CREATE table...

Is there some limitation I am not aware of or is there a simple way to get around this?

thanks, Don
# 2  
Old 03-06-2012
Out of curiosity.. did you run the stored procedure successfully in stand alone mode first rather running through cron..? Because the error seems to be related to database and not with unix environment.
# 3  
Old 03-06-2012
yes - the Stored Procedures run sucessfully stand alone - they will not run via CRON.

Maybe there are some permissions on the database side that need to be set?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Stored Procedure not executing

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... (3 Replies)
Discussion started by: katakamvivek
3 Replies

2. 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

3. 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

4. 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

5. 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

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

Execute an Oracle stored procedure from a shell scrip

Here is a snippet of my code: if then echo "\n Deleting all reports older than 24 hours. \n" >> $logfile ls -l $FileName >> $logfile ... (1 Reply)
Discussion started by: mh53j_fe
1 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