firebird icon indicating copy to clipboard operation
firebird copied to clipboard

Local variable as record from table row [CORE2621]

Open firebird-automations opened this issue 16 years ago • 5 comments

Submitted by: eXandr (i.reg)

Is related to CORE740 Replaces CORE2686 Is duplicated by CORE1998 Relate to CORE3070

Votes: 9

Syntaxis:

DECLARE VARIABLE <varname> RECORD AS [TABLE|VIEW|CURSOR|PROCEDURE[OUTPUT PARAMETERS]] <table_name|view_name|cursor_name|proc_name>;

Example: .. AS DECLARE VARIABLE r RECORD AS TABLE mytable; BEGIN ... SELECT * FROM mytable INTO :r; SELECT fld1 FROM mytable INTO :r.fld1; ... END;

firebird-automations avatar Sep 07 '09 01:09 firebird-automations

Commented by: Ain Valtin (ain)

Looks like a nice feature :) Suggestion - also support to restrict the record variable to have only listed fields, ie

DECLARE VARIABLE <varname> RECORD[(field1, field2, ...)] AS ...

In that case the compiler should replace "*" in SELECT statement

SELECT * FROM mytable INTO :r;

with the field list from var declaration.

firebird-automations avatar Sep 07 '09 03:09 firebird-automations

Modified by: @dyemanov

Link: This issue is related to CORE740 [ CORE740 ]

firebird-automations avatar Sep 23 '09 03:09 firebird-automations

Modified by: @pcisar

Link: This issue replaces CORE2686 [ CORE2686 ]

firebird-automations avatar Oct 19 '09 20:10 firebird-automations

Modified by: @asfernandes

Link: This issue is duplicated by CORE1998 [ CORE1998 ]

firebird-automations avatar Jul 16 '10 18:07 firebird-automations

Modified by: @asfernandes

Link: This issue relate to CORE3070 [ CORE3070 ]

firebird-automations avatar Jul 16 '10 18:07 firebird-automations