Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Quick Question on Passing Parameters

Quick Question on Passing Parameters

From: <amerar_at_iwc.net>
Date: 25 Sep 2006 09:32:19 -0700
Message-ID: <1159201939.866352.224780@m73g2000cwd.googlegroups.com>

Hi All,

I need to pass some parameters into SQLPLUS. I am doing this from a Korn Shell script. However, we do NOT have a stored SQL .sql script on disk, rather we are using this syntax:

sqlplus -s /@$sid << EOT 1>>$LOG_FILE 2>>$LOG_FILE

   set autoprint off
   set feedback off
   set head off
   set term off
   set pages 0
   set echo off
   set lines 150
   col data_type format a20
   spool /u/oracle/tables.txt
   SELECT table_name, column_id, column_name, data_type, data_length FROM dba_tab_columns WHERE owner = '$db_user' ORDER BY table_name, column_id;

   spool off
   exit
EOT Where on that line will the parameters go? Basically I want to create a dynamic spool file name. But as I said, we are not using stored scripts on disk, so there is no .sql file to call....

I've tried the following with errors:

sqlplus -s /@$sid << EOT 1>>$LOG_FILE 2>>$LOG_FILE 'ABC' sqlplus -s /@$sid 'ABC' << EOT 1>>$LOG_FILE 2>>$LOG_FILE

Please advise

Thanks! Received on Mon Sep 25 2006 - 11:32:19 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US