• oracle 存储过程


    存储过程调试

    oracle 查询所有和主表有关系的子表

    select * from user_constraints where 
    R_CONSTRAINT_NAME in (select constraint_name from user_constraints where table_name = 'T_IESUPDATE_DETAILTBLE') ;

     游标---遍历

    declare
           --类型定义
           cursor c_job
           is
           select empno,ename,job,sal
           from emp
           where job='MANAGER';
           --定义一个游标变量v_cinfo c_emp%ROWTYPE ,该类型为游标c_emp中的一行数据类型
           c_row c_job%rowtype;
    begin
           for c_row in c_job loop
             dbms_output.put_line(c_row.empno||'-'||c_row.ename||'-'||c_row.job||'-'||c_row.sal);
           end loop;
    end;
    declare 
           --类型定义
           cursor c_job
           is
           select empno,ename,job,sal
           from emp
           where job='MANAGER';
           --定义一个游标变量
           c_row c_job%rowtype;
    begin
           open c_job;
             loop
               --提取一行数据到c_row
               fetch c_job into c_row;
               --判读是否提取到值,没取到值就退出
               --取到值c_job%notfound 是false 
               --取不到值c_job%notfound 是true
               exit when c_job%notfound;
                dbms_output.put_line(c_row.empno||'-'||c_row.ename||'-'||c_row.job||'-'||c_row.sal);
             end loop;
           --关闭游标
          close c_job;
    end;
    

      使用记录变量

    declare
    type stutype is record(
    stuno int
    stuname chaar(100))

    使用%rowtype 参照某表的记录类型

    使用表变量

    定义一个变量,像数组一样包含多个类型相同的简单变量

    type stutype is table of table.name%type
    [not null] index by binay_integer
    
    st stutype
    begin
    st(0):="董行" 
    
    end 
  • 相关阅读:
    墙内正确安装docker和docker-compose的方法
    VS2015编译ncnn
    caffe模型转ncnn模型
    Ncnn-Installation-on-Windows
    CV2 Fourcc解析
    手动安装OpenCV下的IPP加速库
    Ubuntu下安装Caffe
    Linux安装CUDA教程参考
    最正确的姿势安装cudnn,网上大多数教程都太坑了
    安装多版本cuda时,nvcc和cuda版本不一致问题
  • 原文地址:https://www.cnblogs.com/dh2014/p/6114164.html
Copyright © 2020-2023  润新知