Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Local variable as record from table row [CORE2621] #3031

Open
firebird-automations opened this issue Sep 7, 2009 · 5 comments
Open

Local variable as record from table row [CORE2621] #3031

firebird-automations opened this issue Sep 7, 2009 · 5 comments

Comments

@firebird-automations
Copy link
Collaborator

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
Copy link
Collaborator Author

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
Copy link
Collaborator Author

Modified by: @dyemanov

Link: This issue is related to CORE740 [ CORE740 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

Link: This issue replaces CORE2686 [ CORE2686 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

Link: This issue is duplicated by CORE1998 [ CORE1998 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

Link: This issue relate to CORE3070 [ CORE3070 ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant