The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #4 (permalink)  
Old 08-24-2006
blowtorch's Avatar
blowtorch blowtorch is offline Forum Advisor  
Supporter
  
 

Join Date: Dec 2004
Location: Singapore
Posts: 2,350
Amruta, you could use the shell to do this quite easily:
Code:
#####Connecting sqlplus to check the connectivity
sqlplus -s /nolog <<EOF>/dev/null
connect ${DB_LOGIN}/${DB_PASSWORD}@${DB_NAME}
oldIFS=$IFS
IFS=,
while read acctno salutation name billdate totaldue billdeductiondate billduedate templatecode billid emailid brnno billsummaryid batchno field14 field15 emailfile rest_of_the_fields; do
    echo "Insert into table"
# insert into whatever table, whichever values that you want
# after you are done, go ahead
    echo "Table Appended"
    commit;
    spool off;
    exit;
    EOF
done
field14, field15: hold the 14th and 15th fields, rest_of_the_fields: holds the fields from 17 to end of line. Everything else goes into the appropriately named variables.