Subject Re: Array datatype?
Author

  Use CASE:

azeit = azeit +
  CASE EXTRACT(WEEKDAY FROM :akttag)
    WHEN 0 THEN F0
    WHEN 1 THEN F1
...
    WHEN 6 THEN F6
  END;

Regards,
Vlad

PS procedure contains logical errors, hope it is just a quick sample


---In firebird-support@yahoogroups.com, <check_mail@...> wrote :

In my case, I would like to do this:

 

create procedure P_ARBZEIT(

beginn date,

ende date,

f1 float,

f2 float,

f3 float,

f4 float,

f5 float,

f6 float,

f0 float)

returns (

azeit double precision)

as

declare variable wt integer;

declare variable akttag date;

begin

azeit = 0;

akttag = beginn;

while (akttag = ende or beginn > ende) do

begin

wt = extract(weekday from :akttag);

azeit = azeit + cast('f'||wt as char(2));

akttag = akttag + 1;

end

 

 

  suspend;

end

 

f1 = Monday, f2 = Tuesday.. f0 = Sunday.

 

I get the day from date with weekday and I would add the value from the day to the azeit. Take the value from the variable f0 when it is Sunday.