You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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):
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.
The text was updated successfully, but these errors were encountered: