请问:
在Oracle SQL*PLUS里如下语句:
execute print_id(id=>50,salary=>1200);
请问在参数传递时要用到“=>”是什么意思?从来没见过,但执行是正常的!
请解释一下!
假设print_id过程是这样的:
create or replace procedure print_id(id number default 10,salary number)
is
begin
dbms_output.put_line('编号:' ¦ ¦id ¦ ¦' 工资:' ¦ ¦salary);
end;
/
---------------------------------------------------------------
id=>50 means to assign the parameter "id" with 50
the syntax is used when you have leading parameter(s) with default value(s), by including the name of the formal parameter, you can list only those parameters to which you want to pass values
---------------------------------------------------------------
用这种方法你就可以不用管参数的前后顺序或个数了。
否则,要按顺序输入参数
---------------------------------------------------------------
就是给参数赋值亚,这样不用知道过程内的参数的顺序,这样把in类型的参数都赋值就可以了
---------------------------------------------------------------
乱序给参数赋值