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

Home -> Community -> Usenet -> c.d.o.misc -> Using environment variable in sqlloader

Using environment variable in sqlloader

From: Magnus Lassi <lassi_at_home.se>
Date: Fri, 19 Mar 1999 10:35:42 +0000
Message-ID: <36F2287E.2CC2E8A@home.se>


hi all...

I have the following case. I am running the Oracle database in Unix. I have an enviroment variable called $MONTH which holds the current month
(which I may change when I need to run an old batch for instance).

I know you can use an environment variable in SQLPLUS but can you use it in the controlfile for sqlloader?

I would like to do something like this in the .ctl file:



options (DIRECT = TRUE)
LOAD DATA
TRUNCATE
INTO TABLE test
WHEN (214:219) = $MONTH
(

id POSITION(1:10)

----snip

I also tried the following but it didn't work like I intended:



options (DIRECT = TRUE)
LOAD DATA
TRUNCATE
INTO TABLE test
WHEN (214:219) = '`echo $MONTH`'
(

id POSITION(1:10)
---snip

does anyone have any suggestions? or perhaps an idea of an alternate plan how to do it? I thought of using SYSDATE but didn't quite get it to work..

I will be very thankful for any suggestions..

TIA,
Magnus Lassi Received on Fri Mar 19 1999 - 04:35:42 CST

Original text of this message

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