Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

BCP date format

Posted on 1999-01-20
5
Medium Priority
?
5,199 Views
Last Modified: 2010-10-05
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
0
Comment
Question by:lizzzard
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 

Expert Comment

by:andrewyu
ID: 1098562
You can use it and declare the field in the format file as SQLCHAR !

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)
0
 

Expert Comment

by:andrewyu
ID: 1098563
Anyway, nearly every field type can input as SQLCHAR !

Andrew
0
 

Author Comment

by:lizzzard
ID: 1098564
OK. I have weekend now. I'll try it at soon as possible. Thanks!
0
 

Author Comment

by:lizzzard
ID: 1098565
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


0
 

Accepted Solution

by:
andrewyu earned 200 total points
ID: 1098566
Havn't you try the MM-DD-YYYY format ?

In Windows NT Server, we can set it in the "Regional Setting" !

Andrew
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If something goes wrong with Exchange, your IT resources are in trouble.All Exchange server migration processes are not designed to be identical and though migrating email from on-premises Exchange mailbox to Cloud’s Office 365 is relatively simple…
This month, Experts Exchange sat down with resident SQL expert, Jim Horn, for an in-depth look into the makings of a successful career in SQL.
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question