`

data in DB

 
阅读更多
create or replace procedure EIS_VALIDATE_DB_DATA(out_success out varchar2,
                                                 out_err_msg out varchar2) is

  G_NEW_LINE VARCHAR2(5) := CHR(13);

  G_NUM_AM number := 1;

  G_NUM_SM number := 1;

  G_ID_SM number := 5;

  G_ID_AM number := 4;

  G_ID_PM number := 3;

  v_num_check_1 number default 0;
  v_num_check_2 number default 0;
  v_num_check_3 number default 0;

begin
  out_success := '1';
  -----------------------everyone in EIS should has projects at leaest!!! very important-----------------

  select count(1)
    into v_num_check_1
    from eis_users eu
   WHERE not exists
   (select 'X' from EIS_USER_PROJECTS EUP WHERE EUP.EMP_ID = EU.ID);

  if v_num_check_1 <> 0 then
    out_err_msg := out_err_msg ||
                   ' - Some resource in EIS never in any project' ||
                   G_NEW_LINE;
  end if;

 

  ---------------------------------AM SM can only join project id :0----------------------------------------

  select count(1)
    into v_num_check_1
    from eis_users eu, eis_user_projects eup
   where eu.id = eup.id
     and eu.roles_id in (G_ID_SM, G_ID_AM)
     and eup.project_id <> 0;
     
  if v_num_check_1 <> 0 then
      out_err_msg := out_err_msg ||
                   ' - Some AM or SM join NON-Dummy Projects' ||
                   G_NEW_LINE;
  end if;

  -----------------------There shoud be only 1 pending approve join/relese request for each one----------------
  select count(1)
    into v_num_check_1
    from (select 1
            from eis_project_requests epr
           where epr.request_status_id = 2
           group by epr.requestor_emp_id
          having count(1) > 1);

  if v_num_check_1 <> 0 then
    out_err_msg := out_err_msg ||
                   ' - Some resource have more than one  1 pending approve join/relese request' ||
                   G_NEW_LINE;
  end if;

  -------------------------other check!!--------------------------------------------------------
  

  -----end all validation-----------------------------------
  if out_err_msg is not null then
    out_success := 2;
  end if;

EXCEPTION
  WHEN OTHERS THEN

    out_err_msg := out_err_msg || G_NEW_LINE || G_NEW_LINE || SQLERRM ||
                   ': Procedure Unknown error  ';

    out_success := '0';

end EIS_VALIDATE_DB_DATA;

 

分享到:
评论

相关推荐

    DATA SEGMENT

    DATA SEGMENT GRADE DB 76,69,84,90,73,88,99,63,100,80 MES1 DB '60-69:$' MES2 DB '70-79:$' MES3 DB '80-89:$' MES4 DB '90-99:$' MES5 DB '100:$' C1 DB 0 C2 DB 0 C3 DB 0 C4 DB 0 C5 DB 0 CNT EQU 10 DATA ...

    XMLDB说明DATASHEET

    XML DB ORACLE Oracle XML DB adds high-performance native storage and retrieval of XML content to the capabilities of Oracle Database 10g release 2. The Oracle XML DB Repository makes it possible to ...

    Spark: Big Data Cluster Computing in Production

    Spark: Big Data Cluster Computing in Production English | 2016 | ISBN: 1119254019 | 216 pages | PDF | 5 MB Production-targeted Spark guidance with real-world use cases Spark: Big Data Cluster ...

    DB2 v11.1 DBA Certification Study Guide 2018 pdf

    Understand how to encrypt data in transit and at rest Who This Book Is For The IBM Db2 11.1 Certification Guide is an excellent choice for database administrators, architects, and application ...

    MOVING DATA ACROSS DB2 FAMILY.pdf

    在db2各个平台和各个版本系列数据库之间移动数据的办法。

    DB2CODE返回码

    This edition applies to Version 7 of IBM DATABASE 2 Universal ...www.ibm.com/software/data/db2/os390/library.html). Check these resources to ensure that you are using the most current information.

    Building the Operational Data Store on DB2 U Using IBM Data Replication, Websphere Mq Family, and DB2 Warehouse Manager

    In this IBM Redbook we describe how an Operational Data Store (ODS) can be used to address all of these business issues. We describe how an ODS fits within the business intelligence architecture, and ...

    汇编调试工具

    data segment block db 0,1,0,1,1,1,0,1,1,1 man db ? woman db ? count equ 0ah data ends code segment assume cs:code,ds:data org 1000h start: mov ax,data mov ds,ax mov cx,count mov si,0 mov man,0 ...

    Unload data into CSV file(a delimited file) under DB2 ZOS

    Unload data into CSV file(a delimited file) under DB2 ZOS, 2 sample in real test JCLs

    DB2 9 for z/OS

    DB2® 9 for z/OS® is an exciting new version, with many improvements in performance and little regression. DB2 V9 improves availability and security, as well as adds greatly to SQL and XML functions....

    Aqua Data Studio 18.5.0.12 - 64bit Patch

    Aqua Data Studio displays data in a structured manner, enabling you to create new tables or easily modify existing ones. You can change or create indexes, users, permissions and procedures, as well ...

    DB2 Family Fundamental

    DB2 UDB for z/OS and OS/390 Database Administration Workshop Setting up a DB2 Database Referential Integrity Getting Data into and out...Keeping Your DB2 Data in Good Shape Program Preparation / Bind

    The Data Access Handbook

    Nowadays, 75-95% of the time it takes to process a data request is typically spent in the database middleware. Today’s worst performance and scalability problems are generally caused by issues with ...

    Design and Architecture of CockroachDb

    The map is composed of one or more ranges and each range is backed by data stored in RocksDB (a variant of leveldb), and is replicated to a total of three or more cockroach servers. Ranges are ...

    DB2 getting started

    In this chapter IBM® Data Studio software is used extensively, therefore this eBook is also closely related to eBook Getting Started with IBM Data Studio for DB2. Starting with Chapter 4 the book ...

    Prentice Hall - DB2 Version 8 The Official Guide.chm

    and robustness &lt;br&gt;Using multidimensional data clustering and other integrated business intelligence tools &lt;br&gt;Integrating with IBM WebSphere and Microsoft software development tools &lt;br&gt;...

    Data Analysis Using SQL and Excel(Wiley,2ed,2015)

    Examples include SQL and Excel code, and the appendix shows how non-standard constructs are implemented in other major databases, including Oracle and IBM DB2/UDB. The companion website includes ...

    Data Analysis Using SQL and Excel [2nd Edition, 2016]

    Examples include SQL and Excel code, and the appendix shows how non–standard constructs are implemented in other major databases, including Oracle and IBM DB2/UDB. The companion website includes ...

    Spotting Outliers in Large Distributed Datasets using

    outliers is a very important concept in Knowledge data discovery. Outlier detection has been studied in the context of a large number of research areas like large distributed systems, data mining, ...

Global site tag (gtag.js) - Google Analytics