Subject Re: [firebird-support] raw data format in SP
Author Helen Borrie
At 07:39 PM 29/03/2006, you wrote:
>assuming that tday, tmonth, tyear are integer
>variables with valid values for date (e.g. '05','04','2006' resp.) -
>can I rely that the follwing code in stored procedure will always (on
>any OS, any language settings of OS or BDE or else) will assign to the
>date (or timestamp) variable the value which I expect to be assigned
>(unambiguously, e.g. I expect that the format for SQL is
>always 'dd.mm.yyyy' - is it true?)?:
>
>date_variabel=tday||'.'||tmonth||'.'||tyear;

In this case, you have a string which is acceptable to DSQL as a date
literal (ddmmCCYY). There are several other acceptable
formats: this is just one.

Internally, of course, what is stored is a 32-bit signed integer
(assuming the type you want to store is DATE not TIMESTAMP. DSQL
will accept this string variable as a date literal if you CAST it to type:
e.g.

declare variable date_variable DATE;
....
begin
.....
date_variable = cast(tday||'.'||tmonth||'.'||tyear as DATE);
.....
end

./heLen



>if no - is any workaround how to convert 3 integer values into date
>
>
>
>
>
>
>
>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
>Visit http://firebird.sourceforge.net and click the Resources item
>on the main (top) menu. Try Knowledgebase and FAQ links !
>
>Also search the knowledgebases at http://www.ibphoenix.com
>
>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
>Yahoo! Groups Links
>
>
>
>