Q:

Output parameter value is shown as 'invalid identifier'

I am trying to retrieve values from temporarily created tables. But the return value throws the error 'Invalid Identifier'
create or replace procedure edu_stream (input in varchar2,vals out varchar2)
    as
    inp varchar2(30);
    valu varchar2(30);
    begin
    inp:=input;
    if inp='secondary education' then

         Execute immediate'WITH secedu as (
    (SELECT "ICSE" as name FROM dual ) UNION
    (SELECT "CBSE" as name FROM dual ) UNION
    (SELECT "STATE BOARD" as name FROM dual)
    )        
    SELECT name into valu from(SELECT name
        FROM  secedu ORDER BY DBMS_RANDOM.RANDOM)where rownum<2';

        vals:=valu;

    else 
    if inp='intermediate education' then

      Execute immediate'WITH intedu as (
    (SELECT "MPC" as name FROM dual ) UNION
    (SELECT "BIPC" as name FROM dual ) UNION
    (SELECT "MBIPC" as name FROM dual) UNION
    (SELECT "CEC" as name FROM dual)
    )        
    SELECT name into valu from(SELECT name
        FROM intedu ORDER BY DBMS_RANDOM.RANDOM)where rownum<2'; 

        vals:=valu;

        else 
    if inp='Graduation' then

      Execute immediate'WITH gedu as (
    (SELECT "ECE" as name FROM dual ) UNION
    (SELECT "CSE" as name FROM dual ) UNION
    (SELECT "CE" as name FROM dual) UNION
    (SELECT "EEE" as name FROM dual)UNION
    (SELECT "ME" as name FROM dual)UNION
    (SELECT "AE" as name FROM dual)UNION
    (SELECT "BIOTECH" as name FROM dual)UNION
    (SELECT "EIE" as name FROM dual)
    )       
    SELECT name into valu from(SELECT name
        FROM gedu ORDER BY DBMS_RANDOM.RANDOM)where rownum<2'; 

        vals:=valu;

        else 
    if inp='post-graduation' then

      Execute immediate'WITH pgedu as (
    (SELECT "MCA" as name FROM dual ) UNION
    (SELECT "MTECH" as name FROM dual ) UNION
    (SELECT "MSC" as name FROM dual) UNION
    (SELECT "MBA" as name FROM dual)
    )        
    SELECT name into valu from(SELECT name
        FROM pgedu ORDER BY DBMS_RANDOM.RANDOM)where rownum<2'; 

        vals:=valu;

       else 
    if inp='phd'then

     Execute immediate' WITH phdedu as (
    (SELECT "Doctorate of philosophy" as name FROM dual ) UNION
    (SELECT "doctorate of medicine" as name FROM dual ) UNION
    (SELECT "doctorate of science" as name FROM dual) UNION
    (SELECT "Doctorate of computer sciences" as name FROM dual)
    )        
    SELECT name into valu from(SELECT name
        FROM phdgedu ORDER BY DBMS_RANDOM.RANDOM)where rownum<2'; 

        vals:=valu;
    end if;
    end if;
    end if;
    end if;
    end if;
    end;

Execution:
declare 
value1 varchar2(30);
cv varchar2(30);
begin
cv:='secondary education';
edu_stream(cv,value1);
dbms_output.put_line('val is'||value1);
end;

Error report:

Error starting at line 2 in command: declare  value1 varchar2(30); cv
  varchar2(30); begin cv:='secondary education'; edu_stream(cv,value1);
  dbms_output.put_line('val is'||value1); end; Error report: ORA-00904:
  "ICSE": invalid identifier ORA-06512: at "DATAFOCUS_GROUP.EDU_STREAM",
  line 9 ORA-06512: at line 6
  00904. 00000 -  "%s: invalid identifier"
  *Cause:
  *Action:

if I use 'ICSE'instead of "ICSE"
ERROR SHOWS-

PLS-00103: Encountered the symbol "ICSE" when expecting one of the
  following:
  ERROR     103   * & = - + ; < / > at in is mod remainder not rem
  return
  returning  <> or != or ~= >= <= <> and or
  like like2 like4 likec between into using || multiset bulk
  member submultiset

A:

You can avoid dynamic SQL; also, probably due to confusion created by dynamic sql, you are using " instead of '.
You can re-write your code as:
CREATE OR REPLACE PROCEDURE edu_stream(input IN VARCHAR2, vals OUT VARCHAR2) AS
    inp                                     VARCHAR2(30);
    valu                                    VARCHAR2(30);
BEGIN
    inp    := input;

    IF inp = 'secondary education'
    THEN
        WITH secedu AS
                 ((SELECT 'ICSE' AS name FROM DUAL)
                  UNION
                  (SELECT 'CBSE' AS name FROM DUAL)
                  UNION
                  (SELECT 'STATE BOARD' AS name FROM DUAL))
        SELECT name
          INTO valu
          FROM (  SELECT name
                    FROM secedu
                ORDER BY DBMS_RANDOM.RANDOM)
         WHERE ROWNUM < 2;

        vals    := valu;
    ELSE
        IF inp = 'intermediate education'
        THEN
            WITH intedu AS
                     ((SELECT 'MPC' AS name FROM DUAL)
                      UNION
                      (SELECT 'BIPC' AS name FROM DUAL)
                      UNION
                      (SELECT 'MBIPC' AS name FROM DUAL)
                      UNION
                      (SELECT 'CEC' AS name FROM DUAL))
            SELECT name
              INTO valu
              FROM (  SELECT name
                        FROM intedu
                    ORDER BY DBMS_RANDOM.RANDOM)
             WHERE ROWNUM < 2;

            vals    := valu;
        ELSE
            IF inp = 'Graduation'
            THEN
                WITH gedu AS
                         ((SELECT 'ECE' AS name FROM DUAL)
                          UNION
                          (SELECT 'CSE' AS name FROM DUAL)
                          UNION
                          (SELECT 'CE' AS name FROM DUAL)
                          UNION
                          (SELECT 'EEE' AS name FROM DUAL)
                          UNION
                          (SELECT 'ME' AS name FROM DUAL)
                          UNION
                          (SELECT 'AE' AS name FROM DUAL)
                          UNION
                          (SELECT 'BIOTECH' AS name FROM DUAL)
                          UNION
                          (SELECT 'EIE' AS name FROM DUAL))
                SELECT name
                  INTO valu
                  FROM (  SELECT name
                            FROM gedu
                        ORDER BY DBMS_RANDOM.RANDOM)
                 WHERE ROWNUM < 2;

                vals    := valu;
            ELSE
                IF inp = 'post-graduation'
                THEN
                    WITH pgedu AS
                             ((SELECT 'MCA' AS name FROM DUAL)
                              UNION
                              (SELECT 'MTECH' AS name FROM DUAL)
                              UNION
                              (SELECT 'MSC' AS name FROM DUAL)
                              UNION
                              (SELECT 'MBA' AS name FROM DUAL))
                    SELECT name
                      INTO valu
                      FROM (  SELECT name
                                FROM pgedu
                            ORDER BY DBMS_RANDOM.RANDOM)
                     WHERE ROWNUM < 2;

                    vals    := valu;
                ELSE
                    IF inp = 'phd'
                    THEN
                        WITH phdedu AS
                                 ((SELECT 'Doctorate of philosophy' AS name FROM DUAL)
                                  UNION
                                  (SELECT 'doctorate of medicine' AS name FROM DUAL)
                                  UNION
                                  (SELECT 'doctorate of science' AS name FROM DUAL)
                                  UNION
                                  (SELECT 'Doctorate of computer sciences' AS name FROM DUAL))
                        SELECT name
                          INTO valu
                          FROM (  SELECT name
                                    FROM phdgedu
                                ORDER BY DBMS_RANDOM.RANDOM)
                         WHERE ROWNUM < 2;

                        vals    := valu;
                    END IF;
                END IF;
            END IF;
        END IF;
    END IF;
END;

Also, please notice that the variables inp and valu are not strictly necessary: you can simply use the parameters to check the input value and build the output parameter.
In case you need do use dynamic SQL (not here, but maybe in the future) the right way is something like:
declare
    a number;
begin
    execute immediate 'select 1 from dual' into a;
end;

