-   Programming (
-   -   Regarding date Format (

ancys 08-08-2006 08:23 AM

Regarding date Format
hi all
In table sample column process_date datatype is Date

in unix script i m getting the current date and that value should be updated in process_date
start_date=`date '+%d%m%y'`

/oraclepath uname/pwd@dbname<<EOF
update samp
set process_date='$start_date'

But values is not updated how to update the value in this column
help please!!!

homey 08-08-2006 08:45 AM

You have a typo in the shebang, should be #!/bin/sh
Maybe this example will help.


start_date=$(date '+%d%m%y')

cat << EOF
update samp
set process_date='$start_date'
) > $FILE

ancys 08-08-2006 08:53 AM

The above mentioned code does not update the Process_date column

chrism01 08-09-2006 12:16 AM

Single quotes in bash do not allow interpolation (ie does not translate varname to varvalue). Try double quotes.

bigearsbilly 08-10-2006 05:35 AM

I assume you aren't running it on linux?
Try #!/bin/ksh(i prefer) or #!/bin/bash

linux /bin/sh is bash, not real bourne shell so will work
the unix version of /bin/sh code will not work

All times are GMT -5. The time now is 12:11 AM.