Re: How can i pass an shell Array to sql Session ?.

From: Howard Bryden <100251.1711_at_CompuServe.COM>
Date: 2000/05/12
Message-ID: <8ffsth$egp$1_at_sshuraac-i-1.production.compuserve.com>#1/1


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 CEST

Original text of this message