Home Page for the TeradataForum

Archives of the TeradataForum

Message Posted: Mon, 31 Jan 2005 @ 14:44:40 GMT

  <Prev Next>   <<First <Prev Next> Last>>  

Subj:   Re: DATE Format of INPUT Parameter for STORED PROCEDURE
From:   Michael Larkins


I am not sure if you have a problem since your procedure example does not do anything.

What I do know is that when you have a DATE data type defined in stored procedures, tables, views, macros and everywhere, it is an integer in the format of yyymmdd. The YYY is not a typo, it is the number of years since 1900, therefore this year is 105 years since 1900, today's date is 1050130. Teradata uses a numeric value to represent all dates. When you use a DATE data type in a stored procedure it allows your to pass the data to the DATE parameter in one of four different representations: 'YYYY-MM-DD', 'YY/MM/DD', YYYMMDD(date) and YYYMMDD.

What I have noticed is that if you convert a DATE parameter to a CHAR parameter and return it from a stored procedure it comes back in the 'YY/MM/DD' format when the DATEFORM for the session is ANSIDATE and INTEGERDATE. Is this what you are noticing and not liking? Are you receiving an error in your real stored procedure? Since the example you provided does not do anything it is hard to know what you are experiencing. What is it that makes you think you have a problem?


Michael Larkins
Certified Teradata Master
Certified Teradata SQL Instructor

  <Prev Next>   <<First <Prev Next> Last>>  
  Top Home Privacy Feedback  
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 15 Jun 2023