lizzzard
asked on
BCP date format
Hi,
this is a sort of reposting. I have a datefield in a txt-file I want to bcp-in. (SYB 11.0.2, AIX).
The format of the datefield is dd-mm-yyyy . Up until now I import the datefield as char in a temptable and then select the temptable into my target table using CONVERT in a sp.
What I wanted to know is: Is there a way to tell SYBASE or bcp that the field has to be converted from the dd-mm-yyyy format to a SYB-datetime fiels during te bcp-in
Thanks, Alex
this is a sort of reposting. I have a datefield in a txt-file I want to bcp-in. (SYB 11.0.2, AIX).
The format of the datefield is dd-mm-yyyy . Up until now I import the datefield as char in a temptable and then select the temptable into my target table using CONVERT in a sp.
What I wanted to know is: Is there a way to tell SYBASE or bcp that the field has to be converted from the dd-mm-yyyy format to a SYB-datetime fiels during te bcp-in
Thanks, Alex
Anyway, nearly every field type can input as SQLCHAR !
Andrew
Andrew
ASKER
OK. I have weekend now. I'll try it at soon as possible. Thanks!
ASKER
Hi,
SYBASE doesn't has a SQLCHAR format. It has a SYBCHAR, which is what you mean I think. However, it doesn't like DD-MM-YYYY formats. It only seems to accept a 26 character format like, december 26 1998 12:00:00 AM
SYBASE doesn't has a SQLCHAR format. It has a SYBCHAR, which is what you mean I think. However, it doesn't like DD-MM-YYYY formats. It only seems to accept a 26 character format like, december 26 1998 12:00:00 AM
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
By the way, you can try this by "bcp out" copy the table into file, assign the date field to SQLCHAR and output the format file !
Andrew
(I did it in MS-SQL 6.5)