Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Unix shell script - oracle function

 
Samuel Huang
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

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.

Sam
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18023
47
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic