Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2001
    Location
    Bangalore
    Posts
    186

    Unanswered: Sybase datetime formatting

    Hi,

    I have a extracted sybase data into flat files which i need to load into Oracle tables. Now the problem is i have datetime column which gives me datetime data like this:

    2050-01-01 16:43:35.670

    Oracle accepts the data as per the NLS setting which in my case is
    DD-MON-YYYY HH24:MIS

    Please let me know if we can format the Sybase datetime data to insert into oracle while extracting the data itself into flat files.

    cheers,
    Prashant

  2. #2
    Join Date
    Jul 2005
    Posts
    5
    Create a view take a derived date column and then BCP out to a file
    as
    create view abc as select col_1,col_2,col_dated=
    substring(convert(char(3),100+datepart(dd,date)),2 ,2)+"-"
    substring(datename(mm,date),1,3)+"-"
    convert(char(4),datepart(yy,date))+" "+convert(char(8),date,108)
    from 123

    then

    bcp database.owner.table(or view) out c:\123out -Uusr -Ppwd -Ssrvr -c

    This will work

  3. #3
    Join Date
    Jul 2005
    Posts
    5

    Smile Create A view & use a computed date colums & BCP out

    Create a view take a derived date column and then BCP out to a file
    as
    create view abc as select col_1,col_2,col_dated=
    substring(convert(char(3),100+datepart(dd,date)),2 ,2)+"-"
    substring(datename(mm,date),1,3)+"-"
    convert(char(4),datepart(yy,date))+" "+convert(char(8),date,108)
    from 123

    then

    bcp database.owner.table(or view) out c:\123out -Uusr -Ppwd -Ssrvr -c

    This will work

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •