The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
passing parameter 4m shell script to a DB stored procedure hema2026 Shell Programming and Scripting 0 11-16-2007 06:55 AM
calling a PL/SQL stored procedure from KSH BlAhEr Shell Programming and Scripting 1 10-09-2007 05:18 AM
Calling an Oracle Stored Procedure from Unix shell script Leojhose Shell Programming and Scripting 2 08-06-2007 06:00 AM
Calling stored procedure from shell script dorisw Shell Programming and Scripting 3 06-12-2007 05:03 PM
Calling MYSQL Stored Procedure? kshelluser Shell Programming and Scripting 3 12-19-2006 09:59 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 04-20-2005
priyamurthy2005 priyamurthy2005 is offline
Registered User
  
 

Join Date: Apr 2005
Posts: 4
calling stored procedure from shell script.

Hi All,
This is a very starnge problem I am having. I have a shell script that calls a stored procedure.

Here's my code in shell script:

sqlplus "userid/pwd" @file.sql

and file.sql has the following statement:

exec my_storedProc;

Now, when I execute my shell script, nothing happens, the stored procedure is NOT executed.

But, if I run the same stored procedure not as a script but, do a sqlplus "userid/password" on UNIX, it brings up the sqlplus prompt. Now if I manually type exec myStoredProc; , it runs just fine.

I do not know why it is happening. Also, I am able to run other stored procedures from shell scripts just fine. This is the only stored proceudre that is giving me problem.

FYI, my stored procedures access external tables. I checked permissions on the external tables and they have full access.

Any suggestions will be appreciated.
  #2 (permalink)  
Old 04-21-2005
bhargav's Avatar
bhargav bhargav is offline Forum Advisor  
Registered User
  
 

Join Date: Sep 2004
Location: USA
Posts: 511
try the following ...

Code:
sqlplus "userid/pwd" <<!
exec my_storedProc;
!
  #3 (permalink)  
Old 04-21-2005
tmarikle tmarikle is offline Forum Advisor  
Registered User
  
 

Join Date: Jan 2005
Posts: 683
Quote:
Originally Posted by priyamurthy2005
sqlplus "userid/pwd" @file.sql

and file.sql has the following statement:

exec my_storedProc;

Now, when I execute my shell script, nothing happens, the stored procedure is NOT executed.
How do you know that the stored procedure didn't execute? Are you expecting output? If you are, did you set server output on? If you are not expecting output but rather a transaction to have taken place, is this how you know? If not, you can put a simple insert statement in your SQL script or the stored procedure to see if the transaction took place.

Code:
sqlplus "userid/pwd" <<!
set serveroutput on size 1000000
exec my_storedProc;
!
Quote:
FYI, my stored procedures access external tables. I checked permissions on the external tables and they have full access.
Shouldn't be a problem.

You can also select something from dual to see if you are able to return any rows from you stored procedure.

Thomas

Last edited by tmarikle; 04-21-2005 at 07:26 PM..
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 10:52 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0