Hi
i have a strange thing i have made a script to retrieve the result of an SQL command with sqlplus and if i do an echo to my variable it displays well.
But when i tried to do an update in my oracle table there is a special character at the beginning of my variable.
here is how i have detected in unix the strange char
sed -n l date_file.txt
2012-02-25 01:05:27 +0100$
2012-02-25 01:05:27 +0100$
dt_extract_leads_bf=`sqlplus -s $UID/$PSWD@$SID <<++
set heading off
set feedback off
select value from cleadm.tbpamtecle where name='lastFDWHLDate';
exit;
++`
tr -d '\r' < $dt_extract_leads_bf > date_file.txt
result=`sqlplus -s $UID/$PSWD@$SID <<++
set heading off
set feedback off
UPDATE CLEADM.TBPAMTECLE SET VALUE = '${dt_extract_leads_bf}' where name = 'lastFDWHLDate';
exit;
++`
./test_udpate.sh
A file or directory in the path name does not exist.
test_udpate.sh[19]: ^J^J2012-02-25 01:05:27 +0100: 0403-016 Cannot find or open the file.
can you help me please ?
thanks
ade05fr
---------- Post updated at 05:34 AM ---------- Previous update was at 05:10 AM ----------
thanks i have already solved my problem like that
temp_dt_extract_leads_bf=`sqlplus -s $UID/$PSWD@$SID <<++
set heading off
set feedback off
select TRIM(value) from cleadm.tbpamtecle where name='lastFDWHLDate';
exit;
++`
dt_extract_leads_bf=`echo $temp_dt_extract_leads_bf | tr -s "\n" ""`