I have prepared a shell script which takes 6 char(s) from a file and insert a particular record using sql insert query within a while loop(as the number of records in file is huge).
Upon running the script I am receiving below error - ./TestScriptFor.sh: line 40: syntax error: unexpected end of file
#!/bin/bash
varSIAREQUESTID=$1
varCINAME=$2
#varWORDLENGTH=$3
#DB connection parameter
DBUSER='#USERNAME#'
DBUSERPASSWORD='#PWD#'
DB='oracle'
MYDB='#CONNECTIONSTRING#'
OLDIFS=$IFS
# while loop
while IFS= read -r -n6 LOCATIONID
do
#insert into database
sqlplus -s ${DBUSER}/${DBUSERPASSWORD}@${MYDB} <<EOT
set linesize 32767
set feedback off
set heading off
insert into nbn_sia_locationids (siarequestid,locationid,ciname) values('$varSIAREQUESTID','$LOCATIONID','$CINAME');
exit
EOT
echo "$LOCATIONID"
# display one character at a time
done < TestData.csv
IFS=$OLDIFS