Help Needed: SQL*Plus Variables
From: DAGMARA_at_DELPHI.COM <(DAGMARA_at_DELPHI.COM)>
Date: 1995/11/01
Message-ID: <4794s7$5ho_at_news2.delphi.com>#1/1
Date: 1995/11/01
Message-ID: <4794s7$5ho_at_news2.delphi.com>#1/1
Help! My client is building a generic UNIX script that can be executed by non-UNIX users to extract data from ORACLE tables. They would like to pass ORACLE variables in the command line, but ORACLE hates it. User enters tables names into an ORACLE table read by a UNIX script. The UNIX script generates a unique ORACLE script for each table with a parameter for specific years as follows:
>sqlplus _at_&table_sql_name &yr_parameter
We found a klugy work-around:
spool dummy
>select '_at_&table_sql_name &yr_parameter' from dual;
spool off
_at_dummy
ORACLE recognizes the variables and substitutes appropriately. Any suggestions?
Dagmar Anne Bogan
Kopania & Komorovsky Specializing in Data Architecture Richardson, TX 75081 and Performance Engineering
dagmara_at_delphi.com Received on Wed Nov 01 1995 - 00:00:00 CET