The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Invoking Oracle stored procedure in unix shell script hidnana Shell Programming and Scripting 1 10-15-2008 08:37 AM
Calling an Oracle Stored Procedure from Unix shell script Leojhose Shell Programming and Scripting 2 08-06-2007 07:00 AM
Shell arrays in oracle stored procedure superprogrammer Shell Programming and Scripting 6 06-09-2005 07:36 PM
Execute an Oracle stored procedure from a shell scrip mh53j_fe Shell Programming and Scripting 1 06-03-2005 04:17 PM
Oracle To Korn Shell Array kdst UNIX for Advanced & Expert Users 1 09-24-2002 10:21 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 08-05-2003
Vinny_Mitchell Vinny_Mitchell is offline
Registered User
  
 

Join Date: Aug 2003
Posts: 1
Angry Executing Oracle Stored Procs from Korn Shell

Can someone tell me how to execute an Oracle Stored Procedure from a Korn Shell Script.

Previously, I'm able to execute standard sql using the following:-

The_Output=`sqlplus................. << EOF
select count(*) from abc
/
EOF`

Can I use sqlplus for the Stored Proc ?

Do I need to EXEC the Stored Proc ?

Any help much appreciated with this one !

V.
  #2 (permalink)  
Old 08-05-2003
google's Avatar
google google is offline Forum Advisor  
Moderator
  
 

Join Date: Jul 2002
Location: Atlanta
Posts: 740
You dont need the back quotes and Yes you can use sqlplus to execute the stored procedure. Use a "here" document to execute your statement. You can embed both SQL and PL/SQL in the block. Here is a <<Link>> to a thread that may be of some benefit to you.

the '-s' option puts sqlplus in silent mode

sqlplus -s $USER_ID/$USER_PWD << SQLSTRING

#call package here
#or
#write your SQL and place the block
#inside here. Anything you put in here must
#be valid SQL syntax. Also, for your benefit,
#if you put PL/SQL in here, make sure that
#your DECLARE and END; are not indented
#or spaced in any way. They must be on
#the left margin.


SQLSTRING

Last edited by google; 08-06-2003 at 05:46 AM..
  #3 (permalink)  
Old 08-05-2003
meteor06 meteor06 is offline
Registered User
  
 

Join Date: Aug 2003
Posts: 16
you could EXEC the Stored Proc like this
sqlplus user/userpwd < /yourhomedirectory/your.sql
  #4 (permalink)  
Old 08-06-2003
google's Avatar
google google is offline Forum Advisor  
Moderator
  
 

Join Date: Jul 2002
Location: Atlanta
Posts: 740
Further, you also do the following to execute your standard SQL statement.

sqlplus user/userpwd @/yourhomedirectory/your.sql
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 05:03 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