• sigleSchool 存储过程例1


    CREATE OR REPLACE PROCEDURE SINGLSCHOOL
    (
    PICIID IN VARCHAR2
    , SCHOOLID IN NUMBER
    , SCHETYPE IN number
    , SCHENAME OUT VARCHAR2
    , ISCORE OUT VARCHAR2
    , ISTHRE OUT VARCHAR2
    , ISBASE OUT VARCHAR2
    , ISONLINE OUT VARCHAR2
    , TEACHTO OUT VARCHAR2
    , CLASSCOUNT OUT VARCHAR2
    , STHCOUNT OUT VARCHAR2
    , SCHEID OUT VARCHAR2
    ) AS
    --按照条件查询课程信息
    SCHENAMETMP t_app_dic.f_dic_value%TYPE;
    CORETMP t_app_dic.f_dic_value%TYPE;
    THRETMP t_app_dic.f_dic_value%TYPE;
    BASETMP t_app_dic.f_dic_value%TYPE;
    ONLINETMP t_app_dic.f_dic_value%TYPE;
    TEACHOTMP t_app_dic.f_dic_value%TYPE;
    CLASCTMP NUMBER;
    STUCTMP NUMBER;
    SCHEIDTMP T_APP_SUB_SCHE.ID%TYPE;

    cursor sches (SCHOOLID organization.id%type ,PICIID t_app_pici.id%type,SCHETYPE t_app_sub_sche.f_sche_type%type) is
    select sche.f_sche_name,(select f_dic_value from t_app_dic where f_dic_num= sche.f_sche_core and f_dic_name='核心课程') ,
    (select f_dic_value from t_app_dic where f_dic_num= sche.f_thre_prac and f_dic_name='理论/实践') ,
    (select f_dic_value from t_app_dic where f_dic_num= sche.f_base_pro and f_dic_name='基础/专业') ,
    (select f_dic_value from t_app_dic where f_dic_num= sche.F_ONLINE and f_dic_name='是否开网络课程') ,
    (select f_dic_value from t_app_dic where f_dic_num= sche.F_TEACH_OBJE and f_dic_name='培养对象') ,
    count(sc.f_class_id),sum(c.F_STU_COUNT),SCHE.ID
    from t_app_sub_sche sche,t_app_sche_class sc,t_app_class c
    where c.id(+)=sc.f_class_id and sche.id= sc.f_sche_id(+) and sche.f_validate = '0' and sche.f_subunit_code=(SCHOOLID||'') and sche.f_subunit_pici_pre = PICIID and sche.f_sche_type=SCHETYPE
    group by SCHE.ID,sche.f_sche_name,sche.f_sche_core, sche.f_base_pro, sche.F_ONLINE, sche.F_TEACH_OBJE,sche.f_thre_prac;
    BEGIN

    SCHENAME:=' ';
    ISCORE:=' ';
    ISTHRE:=' ';
    ISBASE:=' ';
    ISONLINE:=' ';
    TEACHTO:=' ';
    CLASSCOUNT:=' ';
    STHCOUNT:=' ';
    SCHEID:=' ';
    open sches(SCHOOLID,PICIID,SCHETYPE);
    LOOP
    fetch sches into SCHENAMETMP,CORETMP,THRETMP, BASETMP , ONLINETMP,TEACHOTMP, CLASCTMP, STUCTMP,SCHEIDTMP;
    exit when sches%notfound;
    SCHENAME:=SCHENAME||SCHENAMETMP||' ,';
    ISCORE:=ISCORE||CORETMP||' ,';
    ISTHRE:=ISTHRE||THRETMP||' ,';
    ISBASE:=ISBASE||BASETMP||' ,';
    ISONLINE:=ISONLINE||ONLINETMP||' ,';
    TEACHTO:=TEACHTO||TEACHOTMP||' ,';
    CLASSCOUNT:=CLASSCOUNT||CLASCTMP||' ,';
    STHCOUNT:=STHCOUNT||STUCTMP||' ,';
    SCHEID:=SCHEID||SCHEIDTMP||' ,';
    end loop;
    close sches;
    DBMS_OUTPUT.PUT_LINE(SCHENAME||'::'||ISCORE||'::'||ISTHRE||'::'||ISBASE||'::'||ISONLINE||'::'||CLASSCOUNT||'::'||STHCOUNT||'::'||TEACHTO);
    END SINGLSCHOOL;

  • 相关阅读:
    jq隐藏页面的一行(循环隐藏10行)
    Button的OnClientClick()事件不起作用?
    Infopath自定义表单实现列表字段联动
    SharePoint 2013的传出电子邮件设置
    codeforces Looksery Cup 2015 D. Haar Features
    codeforces Looksery Cup 2015 H Degenerate Matrix
    poj3321 Apple Tree
    poj1990 MooFest
    poj2155 Matrix
    hdu1556 Color the ball
  • 原文地址:https://www.cnblogs.com/Struts-pring/p/3937783.html
Copyright © 2020-2023  润新知