Basically, I am creating an XML file by taking the values from a column of a table. I am starting an AWK script from a shell script (ksh if it matters) like this:
SQL_RESULT=`sqlplus -s ${CONNECT_STRING} << EOF
${SQLPLUS_SETTINGS}
select customer_id from GD9_GENTH_CUST_SUBSCR;
exit;
EOF`
FILE_LIST=`echo $SQL_RESULT|sed -e 's/\n/''/g'`
echo $FILE_LIST|awk -f awk.file
The AWK script, awl.file, contains:
BEGIN {
print "<?xml version=\"1.0\" encoding=\"UTF-8\"?><GenTransactionHandler xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><EntityToPublish>\n<Entity type=\"C\" typeDesc=\"Customer level\"><TargetApplCode>UHUNLD</TargetApplCode><TrxName>GET_CUST_DATA</TrxName>"
}
{
print "<value>"$1"</value>"
}
END
{
print "</Entity>\n</EntityToPublish></GenTransactionHandler>"
}
When I run the script it gives me an AWK error.
What is the problem with this?