Monday, December 31, 2012

Convert Unix file Creation date into Oracle date


The below code snippet is used to convert the file creation date into oracle date format in unix shell script.
we can get the file creation date of mytextfile.txt and assign into ctime variable. give the ctime variable in oracle insertion script/where clause.
ctime=`stat -c%y mytextfile.txt| sed 's/\..*$//'`

to_date('${lv_ctime}','YYYY-MM-DD HH24:MI:SS')

No comments:

Post a Comment

Item - Category Query

      SELECT      msi.segment1 AS Item_Code,       msi.DESCRIPTION AS Item_Desc,       mcs.CATEGORY_SET_NAME,       mck.CONCATENATED_SEGMEN...