Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How to Call Oracle stored function within shell script

Posted on 2004-11-02
6
Medium Priority
?
257 Views
Last Modified: 2013-12-26
I am trying to write a shell script that should call an Oracle stored function. Some values needs to be passed to this function, and it would also return one value. Please help me on it.
0
Comment
Question by:taniatangri
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
6 Comments
 
LVL 12

Accepted Solution

by:
stefan73 earned 500 total points
ID: 12472494
Hi taniatangri,
Use sqlplus:

sqlplus login/password@instance << EOL
begin
    ...
end
/
quit
EOL


Cheers!

Stefan
0
 
LVL 12

Expert Comment

by:stefan73
ID: 12474269
(Be aware that anyone can see your user and password using the "ps" tool this way)
0
 
LVL 20

Assisted Solution

by:dsacker
dsacker earned 500 total points
ID: 12476025
You can also hide your logon/password with the following:

sqlplus /nolog << EOL
connect login/password@instance
declare
    return_value    varchar2(32);    -- change the type if you are returning another type
begin
    return_value := my_stored_function(passed_value1, passed_value2);
end;
/
quit
EOL
0
 
LVL 16

Expert Comment

by:manav_mathur
ID: 12484838
Taniatangri,

Do you want to pass UNIX variables to your Oracle SP??
and do you want the oracle returned values in UNIX too?? Coz then the scenario changes

Manav
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
In this post we will learn different types of Android Layout and some basics of an Android App.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question