I've got this timestamp field:
if [ "${arr[1]}" != "NUMBER" ];
then
fieldtmst=`echo $var |
awk 'BEGIN { f="'"'"'" }
{
split($0,x,/@#/);
printf "%s\n", f x[1] f
}'`
else
fieldtmst=`echo $var |
awk '{ split($0,x,"@#"); print x[1]}'`
fi
Well this code needs me to make an insert; when i write the insert this part of code recognize if the field i'm going to insert is a NUMBER
or not and if is not NUMBER
this field will be insert with quotes (something like: 'fieldtmst'
) and if is NUMBER
(fieldtmst
) without quotes..Ok, now i have a problem. I have to implement in this code that if is timestamp will be write with quotes of course, and with to_timestamp
and the NLS_DATE_LANGUAGE = American
. So the output of that field will be something like:
to_timestamp('02-JAN-13 01.06.00.000000 PM','DD-MON-YY HH.MI.SS.FF6 AM','NLS_DATE_LANGUAGE = American'),
Understand? Thanks