Personal tools
You are here: Home Forums DB2 can any one change this code as DB2 procedure .
Navigation
Log in


Forgot your password?
 
Document Actions

can any one change this code as DB2 procedure .

Up to DB2

can any one change this code as DB2 procedure .

Posted by abcd at July 18. 2008

CREATE  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
Security Awareness
Would you like your company to implement gamification into your security awareness program?





Polls