![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Invoking Oracle stored procedure in unix shell script | hidnana | Shell Programming and Scripting | 1 | 10-15-2008 04:37 AM |
| Calling an Oracle Stored Procedure from Unix shell script | Leojhose | Shell Programming and Scripting | 2 | 08-06-2007 03:00 AM |
| Execute an Oracle stored procedure from a shell scrip | mh53j_fe | Shell Programming and Scripting | 1 | 06-03-2005 12:17 PM |
| calling stored procedure from shell script. | priyamurthy2005 | Shell Programming and Scripting | 2 | 04-21-2005 04:10 PM |
| Oracle stored procedure. | kamil | UNIX for Advanced & Expert Users | 2 | 11-05-2003 10:39 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Shell arrays in oracle stored procedure
Is it possible to pass unix shell arrays in Oracle stored procedure?
Is yes, how? Thanks |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
The answer is: that depends.
Not taking into account command line restrictions, which may prevent large arrays from being expanded to the command line without error; further not taking into account if an interface for such a huge amount of passed variables is possible to realize in sqlplus or whatever you use to trigger the stored procedure; you could use the variable expansion of the ksh to expand the content of an array: Code:
# myarr[1]="foo"
# myarr[2]="bar"
# print - ${myarr[*]}
foo bar
#
|
|
#3
|
|||
|
|||
|
Hi bakunin
Thanks for the response but I am looking for the syntax on how to pass unix shell arrays in Oracle stored procedure |
|
#4
|
||||
|
||||
|
How are you currently executing your stored procedures via shell? Are you using a Here document ( << EOF .... EOF). If so, you might be able to use the syntax noted above
|
|
#5
|
|||
|
|||
|
Bottom line is that you are not going to be able to pass the array by making a simple assignment to an Oracle stored procedure parameter or variable.
You can do one of the following:
Thomas |
|
#6
|
|||
|
|||
|
Another way to do this:
1. write the contents of the array to something like a pipe-delimited file 2. Write a PL/SQL wrapper for your SP that calls UTL_FILE to read in the file, and create an array out of it, then pass the array (table actually) to the SP. There is no shortcut. |
|
#7
|
|||
|
|||
|
Quote:
Thomas |
|||
| Google The UNIX and Linux Forums |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|