need help with repair script
I have a problem. I am attempting to create a repair script for oracle that will read in a print file and perform a repair on an oracle database using the data in the print file. My restrictions are
1) each in list (items with-in parens) must be no more the 250 lines and the last item in the inlist must not end with a comma, but with a ');'.
Any help with this script would be appreciated.
-------------- Segment of print file --------------
T,10, 31,V, 460, 15,00,1,02,01,B,L,0,0 |
T,11, 29,V, 485, 15,00,1,02,01,B,L,0,0 |
T,12, 36,V, 510, 15,00,1,02,01,B,L,0,0 |
T,13, 21,V, 550, 130,00,1,02,01,B,L,0,0 |
}
{
B,10,N,1|
01,"08054KKAODM "|
02,"P08054KKAODM "|
--------------------------------------------------------
-----------Current Code-----------------
#!/bin/ksh
echo Enter the print number
read PFILE < /dev/tty
echo update po_ln$actn_hst > repair.sql
echo set rcv_labels='N' >> repair.sql
echo where PO_ACTN_TP_CD = 'MAN' >> repair.sql
echo AND RCV_LABELS='Y' >> repair.sql
echo AND po_cd in \( >> repair.sql
cat RLPU_PAR.$PFILE|grep '^01,"'|sort|uniq|cut -c 5-17|sed -e 's/ *$//g'|sed "s/$/',/g"|sed "s/^/'/g" >> repair.sql
----------------------------------------------
--------fragment of Repair.sql ---------------
more repair.sql
update po_ln
set rcv_labels=N
where PO_ACTN_TP_CD = MAN
AND RCV_LABELS=Y
AND po_cd in (
'02154C2EMXO',
'03044K8HKAS',
'0304FF117',
'04019916Y',
'04074KP8704',
'04079936Y',
'04079937Y',
'04079938Y',
-----------------------------------------------
Last edited by beilstwh; 08-16-2004 at 02:35 PM..