If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Sybase > BCP out date format

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-13-10, 03:38
cankaya cankaya is offline
Registered User
 
Join Date: Jul 2010
Posts: 3
BCP out date format

Hi,
I use bcp out to output table data to a file but I have a problem with date and number formats. I want to understand what creates these formats and is it possible to change these.

bcp mydb.dbo.mytable out data_3004_3004.dat -c -t~!~ -r~_!_~ -SASOS -UMYUSR -PMYPASS

To be more specific about what I need
1-)Date columns has a format like "Oct 22 2000 12:00:00:000AM" I want to understand what creates "Oct" part in the format because it is language specific so there has to be a way to change this I think.
2-)Also number columns has "." for before their decimal parts, I don't have a problem with that but I want to understand why it is so, if it is language specific it might turn into "," next time I change language settings

Thanks in advance
Reply With Quote
  #2 (permalink)  
Old 07-13-10, 06:27
Martijnvs Martijnvs is offline
Registered User
 
Join Date: Jan 2004
Location: The Hague/Utrecht, NL
Posts: 396
You can make a view on that table in which you convert the date to another format (like 22/08.2000 12:00:00:000AM ).

BCP itself does not have this functionality as far as I know.
__________________
I'm not crazy, I'm an aeroplane!
Reply With Quote
  #3 (permalink)  
Old 07-13-10, 07:33
cankaya cankaya is offline
Registered User
 
Join Date: Jul 2010
Posts: 3
creating a view might be solution but, I think there should be another solution.

What is exactly causing English month names?
Reply With Quote
  #4 (permalink)  
Old 07-13-10, 08:03
Martijnvs Martijnvs is offline
Registered User
 
Join Date: Jan 2004
Location: The Hague/Utrecht, NL
Posts: 396
Quote:
Originally Posted by cankaya View Post
creating a view might be solution but, I think there should be another solution.

What is exactly causing English month names?
English is the default language in Sybase. You could try installing a different language. That might give you translated monthnames, but it would still be in the same format.
__________________
I'm not crazy, I'm an aeroplane!
Reply With Quote
  #5 (permalink)  
Old 07-13-10, 08:06
cankaya cankaya is offline
Registered User
 
Join Date: Jul 2010
Posts: 3
Ok, thanks.
I guess I have no choice but to use view
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On