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 script #! style startup of sql loader

shell script #! style startup of sql loader

From: <roadrash_at_my-dejanews.com>
Date: Wed, 10 Mar 1999 03:57:20 GMT
Message-ID: <7c4qir$no2$1@nnrp1.dejanews.com>


Hello

Does anyone know how to start up sql loader the way sh , ksh, perl and others operate? ie I want to put on the 1st line something like

#!/ora01/app/oracle/product/7.3.2/bin/sqlldr args....... <body of control file>

In fact #! will not work, the best I have been able to do so far is this:

#!/bin/ksh
CTL_DR=/home/ops/stuf/morestuf/MORE
DAT_FL="$CTL_DR/INPUT/datafile"
i=0

# find a filename that does not exist to put # control file to

while :
do
  ((i = i + 1))
  CTL_FL=$CTL_DR/ctl$i.ctl
  if [[ -a $CTL_FL ]]
  then
    continue
  else
    break
  fi
done

# put control file to tmp file
cat 1>$CTL_FL <<EOF
OPTIONS (rows=1000, errors=500, bindsize=20000000) LOAD DATA
append
INTO TABLE roadrash_s
(abc terminated by ',' enclosed by '"' nullif abc=blanks
, num terminated by ',' enclosed by '"' nullif num=blanks
, date DATE "dd/mm/yyyy" enclosed by '"' nullif date=blanks
, seq_no "nvl(NULL,my_seq.nextval)"
, YorN constant 'N'
, ty_pe constant 1

)
EOF if [[ -f $CTL_FL ]] # just being pedantically anal then
  sqlldr control=$CTL_FL data=$DAT_FL log=/tmp/log userid=scott/tiger_at_INST   rm $CTL_FL #cleanup your temp control file. fi



for the search engines
hash-bang sh-bang '#!' she-bang shell-style startup unix-style interpreter startup

My views are my own, more's the pity I can't afford expensive consultants to give me smarter views.
(in case you haven't figured it out, this is the std. disclaimer to   let my employer off any hook for my actions. )

-----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own Received on Tue Mar 09 1999 - 21:57:20 CST

Original text of this message

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