I'm trying to get this dynamic SQL query to run, but keep running into issues. It is meant to show the number for employees with the role 'Manager' from the 'emp' Oracle Apex sample database.
Declare
Manage_num Number(10);
Manage_count VarChar(150);
Begin
Manage_count := 'Select COUNT(JOB) from emp where JOB='MANAGER'';
Execute Immediate Manage_count into Manage_num;
DBMS_OUTPUT.PUT_LINE ('Total number of Managers is'||Manage_num);
END
This is the error message I keep receiving:
Error at line 4/0: ORA-06550: line 3, column 1: PLS-00103: Encountered the symbol "MANAGE_COUNT" when expecting one of the following:
:= ; not null default character The symbol ";" was substituted for "MANAGE_COUNT" to continue. ORA-06512: at "SYS.WWV_DBMS_SQL_APEX_230100", line 797 ORA-06550: line 5, column 1: PLS-00103: Encountered the symbol "BEGIN" when expecting one of the following:
:= ; not null default character The symbol ";" was substituted for "BEGIN" to continue. ORA-06550: line 6, column 56: PLS-00103: Encountered the symbol "MANAGER" when expecting one of the following:
- & = - + ; < / > at in is mod remainder not rem <an exponent (**)> <> or != or ~= >= <= <> and or like like2 like4 likec between || multiset member submultiset The symbol "* was inserted before "MANAGER" to continue. ORA-06512: at "SYS.DBMS_SYS_SQL", line 1658 ORA-06512: at "SYS.WWV_DBMS_SQL_APEX_230100", line 782 ORA-06512: at "APEX_230100.WWV_FLOW_DYNAMIC_EXEC", line 2035
- Manage_num Number(10)
- Manage_count VarChar(150)
- Begin
- Manage_count := 'Select COUNT(JOB) from emp where JOB='MANAGER'';
- Execute Immediate Manage_count into Manage_num;
I've tried changing the semicolons and changing the syntax based on youtube tutorials with no success
Sorry if this is an easy solution or my question is vague I'm new to the forum.

q'quoting syntax but you could also just use two single quotes for each of the single quotes you have