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 -> Re: call sql oracle 8.i with unix script fails

Re: call sql oracle 8.i with unix script fails

From: Ed Yin <vraagme_at_hotmail.nl>
Date: Sat, 13 Jan 2007 14:09:19 +0100
Message-ID: <497fd$45a8d9e9$50398baa$23489@news.chello.nl>

"Ana C. Dent" <anacedent_at_hotmail.com> schreef in bericht news:Xns98B6C3B00D8B6anacedenthotmailcom_at_69.28.173.184...
> "Ed Yin" <vraagme_at_hotmail.nl> wrote in
> news:4abdb$45a7d753$50398baa$18065_at_news.chello.nl:
>
>> hello,
>>
>> maybe someone can help me out on this script it will only execute 1
>> sql statement depending on what file_name what is wrong with what i am
>> trying to do?
>>
>>
>> i try to call a sql like this depending on interface type
>>
>> this shell is called rim started like this ./rim POR AL
>> where POR
>> is type en AL = $2 file name in this test
>>
>>
>> $1=INTTYPE
>> file_name='test.por'
>> typeO=ORD
>> typeP=POR
>>
>> if $1=$typeO
>> then
>> sqlplus -s / @ord_controle.sql $2 $file_name <<F /
>> echo processing $typeO $1 $sql1 $file_name
>> else $1=$typeP
>> sqlplus -s / @por_controle.sql $2 $file_name <<F /
>> echo processing $typeP $1 $sql2 $file_name
>> show errors;
>> F
>> fi
>> exit 0
>>
>> thanks Ed
>>
>>
>>
>>
>
> First make ity work, then make it fancy.
> I've done *nix for 20+ years & Oracle for 10+
> & for the life of me I have no idea what you are doing.
> It kind of appears you are trying some form of here script,
> which make absolutely no sense inside a shell's "if" statement.

what I am trying to do is this:

inside a unix shell there is 1 sql command and it uses processtype parameter $1 , company $2 and parameter $file_name as collected filename wich conatins the data witch we need to process and what i want to try is this

if parameter $1 is equal to process type ORD then do

"sqlplus -s / @ord_controle.sql $2 $file_name <<F  /
show errors;
F "
this sql statement is checking the transmission data form the file in a transmission table and what i want to do is adding next statement or sql inside this shell script.

if paramater $1 is equal to POR
then next sql is needed to perform checks in database transmission table

"sqlplus -s / @por_controle.sql $2 $file_name <<E  /
show errors;
E"

extra note is besides the procestype also the extension of the file is differend and i parsed it into parameter $ext but i did not used it.

hope even when it is not clear to you it gives an idea what i try to do.

thanks Ed Received on Sat Jan 13 2007 - 07:09:19 CST

Original text of this message

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