1030整理

 2023-09-05 阅读 36 评论 0

摘要:create or replace procedure pr_mytest isv_test number(8);--变量 v_char varchar2(10);c_changl constant number (12,3):= 3.14;--常量 v_bm t_hq_ryxx.bumbm%type;type ty_ry is record --定义了一种记录类型 ( v_xingm t_hq_ryxx.xingm%type, v_xingb t_hq_ryxx.xi
create or replace procedure pr_mytest isv_test number(8);--变量
v_char varchar2(10);c_changl constant number (12,3):= 3.14;--常量

v_bm t_hq_ryxx.bumbm%type;type ty_ry is record --定义了一种记录类型
(
v_xingm t_hq_ryxx.xingm%type,
v_xingb t_hq_ryxx.xingb%type,
v_gongz t_hq_ryxx.gongz%type
);v_ry ty_ry; --声明这种记录类型的变量

v_ryrow t_hq_ryxx%rowtype;--把表的所有字段定义为记录类型

type ty_xs is record
(
v_sno t_hq_student.sno%type,
v_sname t_hq_student.sname%type,
v_class t_hq_student.class%type
);v_xs ty_xs;v_xsrow t_hq_student%rowtype;beginv_char := '你好';select xingm,xingb,gongz into v_ry from t_hq_ryxx where rownum =1;dbms_output.put_line(v_ry.v_xingm ||' '|| v_ry.v_xingb ||' '|| v_ry.v_gongz);select * into v_ryrow from t_hq_ryxx where rownum =1;dbms_output.put_line(v_ryrow.xingm ||' '|| v_ryrow.xingb ||' '|| v_ryrow.gongz);select bumbm into v_bm from t_hq_ryxx where rownum < 2;dbms_output.put_line(v_char ||',测试存储过程,记录条数为:' ||v_bm);select sno,sname,class into v_xs from t_hq_student where rownum =1;dbms_output.put_line(v_xs.v_sno || ' ' || v_xs.v_sname || ' ' || v_xs.v_class );select * into v_xsrow from t_hq_student where rownum = 1;dbms_output.put_line(v_xsrow.sno || ' '|| v_xsrow.sname || ' ' || v_xsrow.sbirthday || ' ' || v_xsrow.class);end pr_mytest;
View Code

转载于:https://www.cnblogs.com/zxw0004/p/4924507.html

版权声明:本站所有资料均为网友推荐收集整理而来,仅供学习和研究交流使用。

原文链接:https://hbdhgg.com/1/1334.html

发表评论:

本站为非赢利网站,部分文章来源或改编自互联网及其他公众平台,主要目的在于分享信息,版权归原作者所有,内容仅供读者参考,如有侵权请联系我们删除!

Copyright © 2022 匯編語言學習筆記 Inc. 保留所有权利。

底部版权信息