Welcome to Scribd. Sign in or start your free trial to enjoy unlimited e-books, audiobooks & documents.Find out more
Download
Standard view
Full view
of .
Look up keyword
Like this
1Activity
0 of .
Results for:
No results containing your search query
P. 1
Untitled

Untitled

Ratings: (0)|Views: 10|Likes:
Published by sivakrishna

More info:

Published by: sivakrishna on Jun 16, 2012
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as TXT, PDF, TXT or read online from Scribd
See more
See less

05/13/2014

pdf

text

original

 
TeradataTimestamptips&tric
 
sSometipswhichmightbeusefulwhilewor
 
ingondateandtimestamp.(queriesrunandverifiedonV2R6)Tip1:CreateTimestampfromDateandTimeSELECTCAST(CAST(CURRENT_DATEASFORMAT'YYYY-MM-DD')||''||CAST(CAST(CURRENT_TIMEASFORMAT'HH:MI:SS')ASCHAR(8))ASTIMESTAMP(0));SELECTCAST(CURRENT_DATEASTIMESTAMP(0))+((CURRENT_TIME-TIME'00:00:00')HOURTOSECOND(0));Tip2:ConverttimestampfieldinTeradataintoformat'MMM-YYYY'selectCURRENT_TIMESTAMP(FORMAT'MMM-YYYY');CurrentTimeStamp(6)-------------------Mar-2010Tip3:Insertingcurrent_timestampvalueintotimestamp(0)columnCreatetablestats(record_timeTIMESTAMP(0));Wheneverwetrytopopulatethecurrent_timestampvalueintothiscolumnusinginsertintostats(record_time)selectcurrent_timestamp;wegetfollowingerror.7454:DateTimefieldoverflow.Toavoidthis,wehavetwosolutionsSolutions:1.DatatypeforCURRENT_TIMESTAMPisTIMESTAMP(6)andyouaretryingtoinsertaTIMESTAMP(6)datatoaTIMESTAMP(0)andthat'swhyyouaregettingthiserror.insertintostats(record_time)Selcast(CURRENT_DATEasTimeStamp(0))+((CURRENT_TIME-time'00:00:00')hourtosecond(0));2.insertintostats

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->