date format
Hi,
I need to do bulk load in Vertica. The data is a dump of an Oracle table. I created a csv file by running Sql Loader and using this csv file as the input to load the Vertica table. I chose to use COPY. The data is getting loaded but I see the date format is MM/DD/YYYY which is not the same as the source table is formatted as 'DD-MON-YY'. I checked the date format in the .csv file, it is 'DD-MON-YY' there too. I went through many different posts on this topic and also the documentation. It will be appreciated, if someone can help. I am not posting my script here but if anyone wants to see my script, please let me know. BTW, I am using Vertica version 5.1. Thanks in advance.
I need to do bulk load in Vertica. The data is a dump of an Oracle table. I created a csv file by running Sql Loader and using this csv file as the input to load the Vertica table. I chose to use COPY. The data is getting loaded but I see the date format is MM/DD/YYYY which is not the same as the source table is formatted as 'DD-MON-YY'. I checked the date format in the .csv file, it is 'DD-MON-YY' there too. I went through many different posts on this topic and also the documentation. It will be appreciated, if someone can help. I am not posting my script here but if anyone wants to see my script, please let me know. BTW, I am using Vertica version 5.1. Thanks in advance.
0
Comments
Post few dates from file, it's enough. This is a format - '29-Jan-2013'?
http://vertica-forums.com/viewtopic.php?f=49&t=251&p=1004#p1004 Daniel
Thanks for your quick response. It’s truly appreciated.
I am able to load the data. The problem I am having is it’s not preserving the date format that’s in the input file. Your results show the same issue I am having. In your test data, you have ’29-Jan-2013’ but the data in the table is stored as ‘2013-01-29’ as displayed by the select statement. Is there a way to fix the format?
My other problem is the year part of the date field. My input file has 31-DEC-99. Although, it’s only showing 99, I know that it’s 31-DEC-9999. When the data is loaded in my vertica table, it’s 1999. I have formatted the column in the COPY statement
EFFECTIVE_END_DT FORMAT 'DD#MON#RR'
The result I am getting is 1999-12-31.
I changed the format to
EFFECTIVE_END_DT FORMAT 'DD#MON#RRRR'
but I am still getting 1999-12-31
Any help will be much appreciated.
Thanks.
Nothing here is wrong. Vertica can define a date format, but you are on wrong way - Vertica isn't a reporting tool, but a analytical. Pretty/beautiful output format (names of month instead of number, weekday name, whatever) must be defined in reporting tools - for that BI/Reporting tools are created and Vertica are created to analyze data.
https://my.vertica.com/docs/7.0.x/HTML/index.htm#Authoring/SQLReferenceManual/Statements/SET/SETDATE... >> My other problem is the year part of the date field. My input file has 31-DEC-99.
I can't help you here - continue to read Oracle docs for solving your problem in Vertica. Sorry, I can't do it.
Where did you find a flag "RR"? Did you tried an banal flag "YY" - 2 digits for year?
Template Patterns for Date/Time Formatting
https://my.vertica.com/docs/7.0.x/HTML/index.htm#Authoring/SQLReferenceManual/Functions/Formatting/T...