• 1030整理


    create or replace procedure pr_mytest is
    
    v_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;
    
    begin
    
    v_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

  • 相关阅读:
    带外数据
    数组中的第K个最大元素
    广播和多播
    反转链表
    ioctl操作
    非阻塞式I/O
    [CSP-S模拟测试]:简单的括号序列(组合数)
    [CSP-S模拟测试]:最大异或和(数学)
    关于我
    [CSP-S模拟测试]:礼物(数学)
  • 原文地址:https://www.cnblogs.com/zxw0004/p/4924507.html
Copyright © 2020-2023  润新知