Hi
I want to set the cntpm local var in my PL/SQL block. This value is originally returned from a SQL that uses the present cursor variable. But I get an error in my code.
DBMS_OUTPUT.ENABLE;
DECLARE CNTPM INTEGER;
CURSOR c1 IS
SELECT distinct proj_code from all_projects_plan ;
BEGIN
FOR item IN c1
LOOP
SET CNTPM =: select count(distinct pm) from MYTABLE where pmloc= 'NA' and p_code = item.proj_code
DBMS_OUTPUT.PUT_LINE('Project = ' || item.proj_code || ' with number of project managers = ' || CNTPM );
IF CNTPM > 1 THEN DBMS_OUTPUT.PUT_LINE ('Several Project managers')
ELSE DBMS_OUTPUT.PUT_LINE ('just one project manager');
END LOOP;
END;
Error starting at line : 1 in command -
DBMS_OUTPUT.ENABLE
Error report -
Unknown Command
Our community of experts have been thoroughly vetted for their expertise and industry experience.
The Most Valuable Expert award recognizes technology experts who passionately share their knowledge with the community, demonstrate the core values of this platform, and go the extra mile in all aspects of their contributions. This award is based off of nominations by EE users and experts. Multiple MVEs may be awarded each year.
The Distinguished Expert awards are presented to the top veteran and rookie experts to earn the most points in the top 50 topics.