ERROR at line 1:
ORA-20000: ORU-10027: buffer overflow, limit of 2000 bytes
ORA-06512: at "SYS.DBMS_OUTPUT", line 35
ORA-06512: at "SYS.DBMS_OUTPUT", line 158
ORA-06512: at "SYS.DBMS_OUTPUT", line 121
ORA-06512: at line 41

The code's attached.The scenario is i have 3 tables one with users (user),one with menus for the user(menu) and another one with permission for the menus this user has(perm).

now this perm table has a field programid it is a concatenated list of all menus(each menu has a 2 digit code),
i have to cut out each 2 digit code and find it's corresponding name in the menu table.
so the final output would be
user1

DBMS_OUTPUT has a default buffer size of 2000 bytes. In Oracle versions prior to 10gR2 you could increase to 1000000 bytes. As of 10gR2 you can set it to "unlimited". 10gR2 also lifted the 256 byte line size limit.

so, if you're on 10gR2 or 11g you can set the serveroutput to unlimited and you're problem is solved.