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 REST with Spring (video course) this week in the Spring 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: 17256

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.

An IDE is no substitute for an Intelligent Developer.
I agree. Here's the link:
subject: Unix shell script - oracle function
It's not a secret anymore!