Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: How can i pass an shell Array to sql Session ?.
Let's assume Korn (or Posix) shell, and SQL*Plus for the Oracle RDBMS. Let the shell array be defined as
set -A x one two three
Now SQL*Plus has no direct means of dereferencing shell environment variables (although you could exploit the Oracle DBMS_PIPE system for this kind of thing). Instead it sets up variables with the DEFINE command.
So a quick hack might be to prepare a SQL*Plus script as a set of DEFINE commands instantiating variables with the values of the array, e.g.
print "
DEFINE x1 = ${x[0]} DEFINE x2 = ${x[1]} DEFINE x3 = ${x[2]}Received on Fri May 12 2000 - 00:00:00 CDT
![]() |
![]() |