"localhost:/firebird/data/ILICHEVSK2.FDB". ��������� Previous topic Chapter index Next topic

DATE_TO_STR

 

������� ���������

��������

���

��������

INPUT_DATA

DATE

 

 

�������� ���������

��������

���

��������

DATESTR

VARCHAR(13)

 

 

��������

(��� �������� ��� ��������� DATE_TO_STR)

 

�����������

CREATE PROCEDURE DATE_TO_STR(
    INPUT_DATA DATE)
RETURNS (
    DATESTR VARCHAR(13))
AS
begin
  if (not (INPUT_DATA is null)) then
    DATESTR = case
                when (extract(day from INPUT_DATA) < 10) then
                  0 || extract(day from INPUT_DATA)
                else extract(day from INPUT_DATA)
              end || '.' ||
              case
                when (extract(month from INPUT_DATA) < 10) then
                  0 || extract(month from INPUT_DATA)
                else extract(month from INPUT_DATA)
              end || '.' ||
              extract(year from INPUT_DATA);
  else DATESTR = '';

  suspend;
end

 

     Previous topic Chapter index Next topic