can any one change this code as DB2 procedure .
Up to DB2can any one change this code as DB2 procedure .
Posted by abcd at July 18. 2008CREATE or REPLACE PROCEDURE COLLABERA(
tablename varchar2(20);
colname varchar2(20);
totrecs number(7);
nullrecs number(7);
BEGIN ATOMIC
BEGIN
SET tablename:='EMP';
SET colname:='EMPNO';
ENG;
select count(*) into totrecs from emp;
select count(*) into nullrecs from emp where empno is null;
//out put has been written in ORACLE Format.
dbms_output.put_line('TABLE NAME'||' '||'Column Name'||' '||'Total Records in Table'||' '||'Null Records for this column');
dbms_output.put_line(tablename||' '||colname||' '||totrecs||' '||nullrecs);
COMMIT;
END;
Powered by
Ploneboard