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

Re: shell variable into bind variable

From: Anton Buijs <aammbuijs_at_xs4all.nl>
Date: Sun, 6 Oct 2002 23:36:58 +0200
Message-ID: <anqad5$c2m$1@news1.xs4all.nl>


Ofcourse not. The value of $max_thatid is replaced by it's value first and then exp is started. That's how ksh and bash variable evaluation works. But does it matter? Why do you really want to see a bind variable? I don't see any method getting a bind variable used in Oracle when a query is passed as exp parameter.

RR <rickraster_at_hotmail.com> schreef in berichtnieuws 97b4acf3.0210061306.1b3db0c3_at_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:36:58 CDT

Original text of this message

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