The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #3 (permalink)  
Old 05-16-2008
fpmurphy fpmurphy is offline
Moderator
 

Join Date: Dec 2003
Location: /ksh93
Posts: 883
No need to use set, awk or cat. Simply set IFS to the delimiter to split the line.
Code:
#!/usr/bin/ksh

IFS=','
while read val1 val2 rest
do
   sqlstmt="update Tablename set Varnum1 = $val2 where Date = '$val1' and UId = 1"
   print $sqlstmt
done < $1
Reply With Quote