SQL中=>是什么意思
展开全部
好像是 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 ) AS
6 BEGIN
7 dbms_output.put_line('Hello ' || p_user_name || p_val1 || p_val2 || '!'
);
8 END HelloWorld3;
9 /
Procedure created.
SQL> BEGIN
2 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> BEGIN
2 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.
参数的默认值
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 ) AS
6 BEGIN
7 dbms_output.put_line('Hello ' || p_user_name || p_val1 || p_val2 || '!'
);
8 END HelloWorld3;
9 /
Procedure created.
SQL> BEGIN
2 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> BEGIN
2 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.
参考资料: http://hi.baidu.com/wangzhiqing999/blog/item/0991d3124070854420a4e9b4.html
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
SQL *和%区别为:作用不同、优先级不同、针对范围不同
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询