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 -> shell variable into bind variable

shell variable into bind variable

From: RR <rickraster_at_hotmail.com>
Date: 6 Oct 2002 14:06:29 -0700
Message-ID: <97b4acf3.0210061306.1b3db0c3@posting.google.com>


Hi all. This is probably a pretty basic question, but I'm stumped... Oracle 8.1.7
RH 7.2, using bash

I have a shell script, run from the command line, that accesses a remote database and returns a numeric value to a shell variable. That part works fine, but I am using that value as part of the QUERY keyword in EXP. Everything works, but I find when I check the shared pool, the shell variable is not a bind variable (obviously my assumption was incorrect).

the shell variable is assigned:
max_thatid=`sqlplus -s xxxxxxxx/xxxxxxxx_at_remote_db @$ORACLE_HOME/bin/get_id.sql`

the get_id.sql script looks like this:
set timing off
set feedback off
set verify off
set heading off
set echo off
select max(thatid) from the_table;
set timing on
exit

the export is run like so:
EXP ... query=\"where thisid \> $max_thatid\"

the shared pool then shows this:
...

SELECT /*+NESTED_TABLE_GET_REFS+*/ "me"."the_table".* FROM "me"."the_table" where thisid > 15379950
...

No doubt it's something simple and obvious, but I am certainly missing it!

Thanks!!!

Cheers,

Rick Received on Sun Oct 06 2002 - 16:06:29 CDT

Original text of this message

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