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

Ability to passing input procedure parameters by name [CORE4152] #4479

Closed
firebird-automations opened this issue Aug 1, 2013 · 4 comments
Closed

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: Vladimir Arkhipov (arkinform)

Votes: 2

Sometimes in large stored procedures there are many input parameters with default values but in each case we need to use only small part of them.
Now we have to list all previous parameters (unneeded) with their default values and then pass needed parameter with specific value.
It is very unconvenient. I have to remember parameters order and their default values too. This means that in future I can not simply change default value for parameter because it is used in many other variations of using.

I think that following syntax will be excelent (like passing parameters in execute statement):

create procedure some_procedure
(
param1 integer,
param2 integer = -1,
param3 varchar(64) = ''
)
returns
(
field1 integer,
field2 integer
)

select * from some_procedure (param1 := :param_value1, param3 := :param_value2)
or
select * from some_procedure (param1 := 10, param3 := 'Test')
or
execute procedure some_procedure (param1 := 10, param3 := 'Test')

In this case param2 will be passed with its default value.
If required parameter (with no default value) is not passed then should be the error.

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

I'm was almost sure there is a identical ticket registered, or it's just on my head, cause I did not found it.

The idea is it. Use the := operator as you said.

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

assignee: Adriano dos Santos Fernandes [ asfernandes ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

Version: 3.0 Alpha 1 [ 10331 ] =>

Version: 3.0 Alpha 2 [ 10560 ] =>

Version: 3.0 Beta 1 [ 10332 ] =>

Version: 3.0.0 [ 10048 ] =>

@asfernandes
Copy link
Member

Closing this in favor of PR #7557

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

2 participants