oracle中=>是什么意思呢?如下所示

declare
type emp_record is record(f_name employees.first_name%type,h_date employees.hire_date%type);
v_emp_record emp_record;
cursor c3(dept_id number,j_id varchar2) return emp_record
is
select first_name,hire_date from employees where department_id=dept_id and job_id=j_id;
begin
open c3(j_id=>'AD_VP',dept_id=>90);
loop
fetch c3 into v_emp_record;
if c3%found then
dbms_output.put_line(v_emp_record.f_name||'的雇用日期是:'||v_emp_record.h_date);
else
dbms_output.put_line('已经处理完结果集');
exit;
end if;
end loop;
close c3;
end;

蛊毒传说
浏览 411回答 2
2回答

芜湖不芜

c3是一个存储过程或者函数一般如果是按顺序填写参数的时候,是不需要用=>符号的,但是Oracle可以让你在调用的时候,指定"参数名称=>参数值", 这样就可以不按参数的顺序进行调用.因为Oracle系统提供的很多存储过程中,参数非常多,每次调用也不是每个参数都必须指定.

UYOU

=> 是 Oracle 中调用 存储过程的时候, 指定 参数名进行调用.一般是, 某些参数有默认值的时候,你需要跳过某些参数来进行调用。下面是具体的例子。参数的默认值SQL> CREATE OR REPLACE PROCEDURE HelloWorld3 (2 p_user_name VARCHAR2,3 p_val1 VARCHAR2 DEFAULT ' Good Moning,',4 p_val2 VARCHAR2 DEFAULT ' Nice to Meet you'5 ) AS6 BEGIN7 dbms_output.put_line('Hello ' || p_user_name || p_val1 || p_val2 || '!');8 END HelloWorld3;9 /Procedure created.SQL> BEGIN2 HelloWorld3('Edward');3 HelloWorld3('Edward', ' Good Night,');4 HelloWorld3('Edward', ' Good Night,', 'Bye');5 END;6 /Hello Edward Good Moning, Nice to Meet you!Hello Edward Good Night, Nice to Meet you!Hello Edward Good Night,Bye!PL/SQL procedure successfully completed.指定参数名称调用此部分使用 “参数默认值”那一小节的存储过程。用于说明当最后2个参数是有默认的时候,如何跳过中间那个。SQL> BEGIN2 HelloWorld3('Edward');3 HelloWorld3('Edward', p_val1 => ' Good Night,');4 HelloWorld3('Edward', p_val1 => ' Good Night,', p_val2 => 'Bye');5 HelloWorld3('Edward', p_val2 => ' HeiHei ');6 END;7 /Hello Edward Good Moning, Nice to Meet you!Hello Edward Good Night, Nice to Meet you!Hello Edward Good Night,Bye!Hello Edward Good Moning, HeiHei !PL/SQL procedure successfully completed.
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

MySQL
Oracle