DB2 CRUD Reportor

SQL Server version | Oracle version | DB2 version | MySQL version

Database consultant, DBA and SQL developers always need to read SQL scripts to find out the tables have Create, Read, Update, Delete and Insert operations against them. If SQL scripts is complex and large than 100 lines, then it's almost impossible to do that without help with a tool. If you need to analyze hundred's of SQL scripts, then you will need a tool or API help you to do that definitely.

General SQL Parser can help you to do that automatically with less than 100 lines C# code(The code is ready here). This code can search all tables in Oracle PLSQL scripts(including procedure/function/package), function/procedure of SQL Server, MySQL and DB2. No matter how complex and large the SQL script is, as long as it's syntax valid, this CRUD reportor can process that well. Of course, you can modify this code to fit your own need.

Take the following DB2 function for example, CRUD Reportor can tell you that in deptemployees function, selected table: EMPLOYEE(1). Inserted table: AUDIT(1).

 

CREATE FUNCTION deptemployees (deptno CHAR(3))
  RETURNS TABLE (empno CHAR(6), lastname VARCHAR(15), firstname VARCHAR(12))
  LANGUAGE SQL
  MODIFIES SQL DATA
  NO EXTERNAL ACTION
  DETERMINISTIC
  BEGIN ATOMIC
    INSERT INTO audit
    VALUES      (USER, 'Table:EMPLOYEE Prd:DEPTNO ='
                        || deptno);

    RETURN SELECT empno,
                  lastname,
                  firstnme
           FROM   employee
           WHERE  employee.workdept = deptemployees.deptno;
  END@ 

 

Questions?

If you have any questions about General SQL Parser and this CRUD reportor, You can always send us an email and we'll get back to you within 24 hours.

 

Any other benefits can I get by using this SQL Parser?

Yes, of course. We collect all kinds of examples in this page to illustrate how and why you want to use general sql parser, hope it can help you to make better use of this library.