Subject AW: [firebird-support] Array datatype?
Author Check_Mail

..statement does not works, local variables does the statement not found..

 

create or alter procedure P_ARBZEIT (

    BEGINN date,

    ENDE date,

    F1 float,

    F2 float,

    F3 float,

    F4 float,

    F5 float,

    F6 float,

    F0 float)

returns (

    AZEIT float)

AS

declare variable wt integer;

declare variable akttag date;

declare variable stmtxt varchar(100);

begin

azeit = 0;

akttag = beginn;

if(beginn > ende) then exit;

while (akttag <= ende) do

begin

wt = extract(weekday from :akttag);

stmtxt = 'select cast(:azeit + :f' || cast(wt as char(1)) || '  as float) from rdb$database' ;

execute statement stmtxt into :azeit;

akttag = akttag + 1;

end

 

 

  suspend;

end

 

Von: firebird-support@yahoogroups.com <firebird-support@yahoogroups.com>
Gesendet: Mittwoch, 28. August 2019 16:18
An: firebird-support@yahoogroups.com
Betreff: AW: [firebird-support] Array datatype?

 

 

Hello Dimitry,

 

is there no way? I know the thing with the execute statement, but it is not the best solution. I would like to add a value, if the weekday is 1 (Monday), then I would like to take the variable t1 and add the value from t1 to the sum..

 

 

Von: firebird-support@yahoogroups.com <firebird-support@yahoogroups.com>
Gesendet: Mittwoch, 28. August 2019 15:48
An: firebird-support@yahoogroups.com
Betreff: AW: [firebird-support] Array datatype?

 

 

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.

 

My question about the array, because I can set if it is possible (array[0,8,8,8,8,8,0] and array[weekday])

 

Von: firebird-support@yahoogroups.com <firebird-support@yahoogroups.com>
Gesendet: Mittwoch, 28. August 2019 15:29
An: firebird-support@yahoogroups.com
Betreff: [firebird-support] Array datatype?

 

 

Hello,

 

I have test something like this:

 

Declare vat integer[7] or {7}.

 

How can I define an array datatype and use it in some functions? (vat[1]/vat[countervail])

 

Thank you.