File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Linux / UNIX and the fly likes Unix shell script - oracle function Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "Unix shell script - oracle function" Watch "Unix shell script - oracle function" New topic

Unix shell script - oracle function

Samuel Huang

Joined: Oct 29, 2001
Posts: 8

I have an application that calls a unix shell script This unix shell script calls a oracle function in the PL/SQL package. For example,

In package pkg_test, there is function f_test. This function returns pls_interger.

How can I write a unix shell script to return the value from the oracle function, so that the application can get the value from the unix shell script?

Many thanks.

Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15629

You have 2 options.

1. Code up a call to the Oracle command-line utility (sql*plus) and have it run the stored procedure.

2. Code up a JDBC application in Java to invoke the stored procedure.

Oracle commands are not stand-alone applications, so you have to have some other application to run them. You can't script them directly.

Customer surveys are for companies who didn't pay proper attention to begin with.
I agree. Here's the link:
subject: Unix shell script - oracle function
Similar Threads
issue when calling shell script from java
Need unix shell script Help
Returning error code from jar application
Running a .jar application from a unix shell script
Returning error code from jar application