zhaolixin007
zhaolixin007
采纳率0%
2017-04-18 15:15 阅读 784

存储过程问题 嵌套 游标问题 求教,急!

21

tst_client_info:
create table tst_client_info (
clientno varchar2(12),
clientno_name varchar2(50),
birth_date date,
sex varchar2(1),
id_type varchar2(1),
idno varchar2(30)
)

procedure plsql_procedure_1 (p_clientno in tst_client_info. clientno%type,
p_idno out tst_client_info .idno%type) is
cursor c_client_info(c_clientno tst_client_info.clientno%type) is

select idno from tst_client_info where clientno = c_clientno;

begin
open c_client_info(p_clientno),
fetch c_client_info
into p_idno;
close c_client_info;
end plssql_procedure_1;

procedure plsql_procedure_2 (p_clientno in tst_client_info,clientno%type,
p_idno out tst_client_info.idno%type) is
begin
select idno
into p_idno
from tst_client_info
where clientno = p_clientno;

end plsql_procedure_2;

如下函数功能是:
procedure plsql_procedure_3(p_clientno in tst_client_info,clientno%type,
p_idno out tst_client_info.idno%type) is
v_clientno tst_client_info.clientno%type;

cursor c_client_info is
select clientno from tst_client_info where idno = p_idno;
begin
open c_client_info;
loop
fetch c_client_info
into v_clientno;
exit when c_clinet_info%not found;

 p_clientno(p_clientno.count) := v_clientno;

end loop;
close c_clinet_info;
end plsql_procedure_3;

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

3条回答 默认 最新

  • qq_31515997 hello.. 2017-04-19 02:40

    1, selct t2.* from t2 ,(select * from t3 where t3.按键号='E0001')A where t2=a.账单号
    2, to_date('2017-10-11','yyyy-mm-dd')
    3, select substr('12345',0,1) from dual; // 截取字符串的第一位 下标是重0开始 结果1
    4, select concat('12','58') from dual
    5, select NLS_UPPER('abcde') "test" from dual;
    6,
    select (case when aa.x1 is not null then aa.x1 else aa.x2 end ) de from ms_equipment aa
    7,看第三就明白了 select ms_equipment.checkuse, ms_equipment.id ,(case ms_equipment.type_id when is not null then 88 else 8 end ) de from ms_equipment
    8:太长了没时间看

    点赞 1 评论 复制链接分享
  • devmiao devmiao 2017-04-18 15:52
    点赞 评论 复制链接分享
  • hzh0816 hzh0816 2017-04-19 09:46

    很多问题度娘都能解决, 太简单了没人回答, 太复杂了又没人看, 所以多找度娘吧

    点赞 评论 复制链接分享

相关推荐