Re: Need help with default parameters
Posted in 1998
aurelito wrote:
>Hi, I am a green Informix developer. I create procedures with default values in their parameters,but
>I don't know how to pass the arguments. For example,
>
>create procedure p1 (a integer, b varchar(5) default 'hello', c integer)>...
>end procedure;
>.........
>.....
>
>execute procedure p1(1,'bleee',4);
>execute procedure p1(1,5) <---ERROR. How can I match the default value with a missing argument? (The
>string in this case)>
You could try:
execute procedure p1(a=1, c=5)
If you don't want to use this kind of statement, you should
put all your parameters with default values at the end of parameters
list (i.e. after all parameters without default values). In this case
you will have to pass just the values for parameters without defaults
values.
Hope it helps,
Octav
--
Octav Chiriac Phone: (373) 2 21 20 96
NetInfo S.R.L. Fax: (373) 2 21 36 59
Chisinau (373) 2 24 00 83
Moldova, Republic of mailto:com@netinfo-moldova.com