Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2012
    Posts
    1

    Unanswered: Error(1,28): PLS-00103: Encountered the symbol ")" when expecting one of the followin

    I want to create below CURSOR as procedure but really getting the error

    Error(1,28): PLS-00103: Encountered the symbol ")" when expecting one of the following: <an identifier> <a double-quoted delimited-identifier> current

    again and again...

    Sum1 can help?




    CREATE OR REPLACE

    PROCEDuRE FindUpdateDate

    as

    --set serveroutput on
    emp_rec tab2%rowtype;
    match_count date;
    match_count1 date;
    --match_count2 date;
    --match_count3 date;
    CURSOR emp_cur IS

    SELECT * FROM tab2;
    BEGIN
    OPEN emp_cur;
    LOOP
    FETCH emp_cur INTO emp_rec;
    EXIT WHEN emp_cur%NOTFOUND ;
    EXECUTE IMMEDIATE
    'select max(CREATion_DATE) from '||emp_rec.table_name||' ' into match_count ;
    EXECUTE IMMEDIATE
    'select max(last_updATED_DATE) from '||emp_rec.table_name||' ' into match_count1 ;



    dbms_output.put_line (emp_rec.table_name || ' Creation_Date is ' || ''||match_count);
    dbms_output.put_line (emp_rec.table_name || ' Last_Updated_Date is ' || ''||match_count1);
    --dbms_output.put_line (emp_rec.table_name || ' Created_Date is ' || ''||match_count2);
    --dbms_output.put_line (emp_rec.table_name || ' Updated_Date is ' || ''||match_count3);

    END LOOP;

    exception
    when NO_DATA_FOUND
    then null;

    CLOSE emp_cur;
    END ;
    /

  2. #2
    Join Date
    Jan 2012
    Posts
    84
    Code:
    /*
    EXECUTE IMMEDIATE
    'select max(CREATion_DATE) from '||emp_rec.table_name||' ' into match_count ;
    EXECUTE IMMEDIATE
    'select max(last_updATED_DATE) from '||emp_rec.table_name||' ' into match_count1 ;
    */
    
    EXECUTE IMMEDIATE
    'declare x date; begin  select max(CREATion_DATE) into x from '||emp_rec.table_name||'; :x := x; end; ' 
     using in out match_count ;
    EXECUTE IMMEDIATE
    'declare x date; begin select max(last_updATED_DATE) into x from '||emp_rec.table_name||'; :x :=x; end; '
     using in out match_count1 ;

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •