0
votes

I am using DB2 IBM data studio, and I cannot print logs:

create procedure test_ticket 
begin 
     declare stmt varchar(500); 
     DECLARE QTY INTEGER;    
     SET QTY = (select count(*) from test.ticket);
    CALL DBMS_OUTPUT.PUT_LINE( QTY );

end 

No authorized routine named "DBMS_OUTPUT.PUT_LINE" of type "PROCEDURE" having compatible arguments was found.. SQLCODE=-440, SQLSTATE=42884, DRIVER=4.18.60

1
May be it's not available in your DB2 version?mustaccio
@mustaccio my db2 version 9.5.3kinkajou

1 Answers

0
votes

As @mustaccio surmised, the DBMS_OUTPUT module was not present in DB2 9.5. It was introduced as part of the Oracle compatibility features in DB2 9.7.

You may also want to note that DBMS_OUTPUT.PUT_LINE takes an argument of VARCHAR, not INT.