Encountered the symbol "LOOP" when waiting for him...

Hello, I run this code:
DECLARE
CURSOR cur IS SELECT ID, SEQNR, TRPELID FROM ITAI11_MP2103 WHERE ROWNUM<10 ORDER BY ID, SEQNR;
rec cur%ROWTYPE;
prohibLink1 cur.TRPELID%TYPE;
prohibLink2 cur.TRPELID%TYPE;
prohibLink3 cur.TRPELID%TYPE;
prohibLink4 cur.TRPELID%TYPE;
prohibLink5 cur.TRPELID%TYPE;
  
currMPID cur.ID%TYPE;
currSeq1ID cur.TRPELID%TYPE;
linkIDSeq2 PL_LINK$.LINK_ID%TYPE;
  
BEGIN
OPEN cur;
LOOP
FETCH cur INTO rec; 
EXIT WHEN cur%NOTFOUND;

IF (rec.SEQNR = 1) THEN
currMPID := rec.ID;
currSeq1ID := rec.TRPELID;
SELECT PL1, PL2, PL3, PL4, PL5 INTO prohibLink1, prohibLink2, prohibLink3, prohibLink4, prohibLink5 FROM PL_LINK$ WHERE ID = rec.TRPELID;

ELSE IF (rec.SEQNR = 2) AND (currMPID = rec.ID) THEN SELECT LINK_ID INTO linkIDSeq2 FROM  PL_LINK$ WHERE ID = rec.TRPELID;

IF (prohibLink1 IS NULL) THEN UPDATE  PL_LINK$ SET PL1 = linkIDSeq2 WHERE ID = currSeq1ID;
DBMS_OUTPUT.PUT_LINE('Setting PL1 = '||linkIDSeq2||' for link with ID = '||currSeq1ID);

ELSE IF (prohibLink2 IS NULL) THEN UPDATE PL_LINK$ SET PL2 = linkIDSeq2 WHERE ID = currSeq1ID;
DBMS_OUTPUT.PUT_LINE('Setting PL2 = '||linkIDSeq2||' for link with ID = '||currSeq1ID);

ELSE IF (prohibLink3 IS NULL) THEN UPDATE PL_LINK$ SET PL3 = linkIDSeq2 WHERE ID = currSeq1ID;
DBMS_OUTPUT.PUT_LINE('Setting PL3 = '||linkIDSeq2||' for link with ID = '||currSeq1ID);

ELSE IF (prohibLink4 IS NULL) THEN UPDATE PL_LINK$ SET PL4 = linkIDSeq2 WHERE ID = currSeq1ID;
DBMS_OUTPUT.PUT_LINE('Setting PL4 = '||linkIDSeq2||' for link with ID = '||currSeq1ID);

ELSE IF (prohibLink5 IS NULL) THEN UPDATE PL_LINK$ SET PL5 = linkIDSeq2 WHERE ID = currSeq1ID;
DBMS_OUTPUT.PUT_LINE('Setting PL5 = '||linkIDSeq2||' for link with ID = '||currSeq1ID);
END IF;

END IF;
END LOOP;
CLOSE cur;
END;
/
but I have:

*
ERROR on line 44:
ORA-06550: line 44, column 5:
PLS-00103: encountered the symbol "LOOP" when expecting one of the following conditions:
If
ORA-06550: line 46, column 4:
PLS-00103: encountered the symbol "end-of-file" when awaits an of the
Next:
not end up dominant static of final instantiable order pragma
manufacturer membership card

you know what mean?

Thank you very much.

Try this:

DECLARE
CURSOR cur IS SELECT ID, SEQNR, TRPELID FROM ITAI11_MP2103 WHERE ROWNUM<10 ORDER BY ID, SEQNR;
rec cur%ROWTYPE;
prohibLink1 ITAI11_MP2103.TRPELID%TYPE;  -- referred a column type from a table instead of a cursor
prohibLink2 ITAI11_MP2103.TRPELID%TYPE;  -- referred a column type from a table instead of a cursor
prohibLink3 ITAI11_MP2103.TRPELID%TYPE;  -- referred a column type from a table instead of a cursor
prohibLink4 ITAI11_MP2103.TRPELID%TYPE;
prohibLink5 ITAI11_MP2103.TRPELID%TYPE;

currMPID ITAI11_MP2103.ID%TYPE;
currSeq1ID ITAI11_MP2103.TRPELID%TYPE;
linkIDSeq2 PL_LINK$.LINK_ID%TYPE;

BEGIN
OPEN cur;
LOOP
FETCH cur INTO rec;
EXIT WHEN cur%NOTFOUND;

IF (rec.SEQNR = 1) THEN
currMPID := rec.ID;
currSeq1ID := rec.TRPELID;
SELECT PL1, PL2, PL3, PL4, PL5 INTO prohibLink1, prohibLink2, prohibLink3, prohibLink4, prohibLink5 FROM PL_LINK$ WHERE ID = rec.TRPELID;

ELSIF (rec.SEQNR = 2) AND (currMPID = rec.ID) THEN

SELECT LINK_ID INTO linkIDSeq2 FROM  PL_LINK$ WHERE ID = rec.TRPELID;

IF (prohibLink1 IS NULL) THEN UPDATE  PL_LINK$ SET PL1 = linkIDSeq2 WHERE ID = currSeq1ID;
DBMS_OUTPUT.PUT_LINE('Setting PL1 = '||linkIDSeq2||' for link with ID = '||currSeq1ID);

ELSIF (prohibLink2 IS NULL) THEN UPDATE PL_LINK$ SET PL2 = linkIDSeq2 WHERE ID = currSeq1ID;
DBMS_OUTPUT.PUT_LINE('Setting PL2 = '||linkIDSeq2||' for link with ID = '||currSeq1ID);

ELSIF (prohibLink3 IS NULL) THEN UPDATE PL_LINK$ SET PL3 = linkIDSeq2 WHERE ID = currSeq1ID;
DBMS_OUTPUT.PUT_LINE('Setting PL3 = '||linkIDSeq2||' for link with ID = '||currSeq1ID);

ELSIF (prohibLink4 IS NULL) THEN UPDATE PL_LINK$ SET PL4 = linkIDSeq2 WHERE ID = currSeq1ID;
DBMS_OUTPUT.PUT_LINE('Setting PL4 = '||linkIDSeq2||' for link with ID = '||currSeq1ID);

ELSIF (prohibLink5 IS NULL) THEN UPDATE PL_LINK$ SET PL5 = linkIDSeq2 WHERE ID = currSeq1ID;
DBMS_OUTPUT.PUT_LINE('Setting PL5 = '||linkIDSeq2||' for link with ID = '||currSeq1ID);
END IF;

END IF;
END LOOP;
CLOSE cur;
END;
/ 

PS: Not tested

Tags: Database

Similar Questions

  • PLS-00103: encountered the symbol 'NUMBER' when awaits a the follow

    Hi, I have this error:-

    OS: xp
    Oracle 8i

    SQL > Create or replace procedure Balance_chk is
    mclient_no 2 number (5);
    3 mbal_due number (10.2);
    4 less_than_min_bal
    number (3) add_amt 5.
    min_bal 6 number (7.2);
    7. start
    8 add_amt: = 500;
    9 min_bal: = 2000;
    10 mClient_no: = & mClient_no;
    11. Select bal_due in the Client_mast mbal_due where client_no = mClient_no;
    12 if mbal_due > = Min_bal then
    13 update client_mast set bal_due = (mbal_due + add_amt) where client_no is mclient_no;.
    14 end if;
    15 exception
    16 when less_than_min_bal then
    17 dbms_output.put_line (' balance ' | bal_due);
    18 end;
    19.
    Enter the value for mclient_no: 10001
    10 old: mClient_no: = & mClient_no;
    new 10: mClient_no: = 10001;

    CAUTION: Procedure created with compilation errors.

    SQL > show error
    Errors in PROCEDURE BALANCE_CHK:

    LINE/COL ERROR
    -------- -----------------------------------------------------------------
    5/9 PLS-00103: encountered the symbol 'NUMBER' when waiting for an a
    What follows:
    := . (@ %; not null default range character)
    The symbol ': = ' was replaced by 'NUMBER' to continue.

    you are missing; at the end of the line 4

  • has encountered an error "PLS-00103: encountered the symbol"CREATE"when expec".

    Hi all

    I am creating a procedure and try to use the temporary table...

    Here is the code:
    --------------------------------------------------------------------------------------------------------------------------------------------
    PROCEDURE P_PARENT_TREE
    (
    topic_id_in in NUMBERS
    topic_hierarchy_details_out ON SYS_REFCURSOR
    ) IS

    temp_children_level topic_children.children_level%TYPE;
    temp_children_id topic_children.children_id%TYPE;
    temp_topic_id topic.topic_id%TYPE;

    CURSOR c_child_level IS
    SELECT children_level, children_id
    OF topic_children
    WHERE children_id = topic_id_in;

    BEGIN

    OPEN c_child_level.
    EXTRACT c_child_level INTO temp_children_level, temp_topic_id;
    CLOSE C_child_level;

    Topic_child CREATE TEMPORARY TABLE IF NOT EXISTS
    (t_topic_id, NUMBER, NUMBER, children_seq NUMBER of t_children_id);

    WHILE temp_children_level > 0
    LOOP
    INSERT INTO topic_child (t_topic_id, t_children_id, children_seq)
    values)
    SELECT topic_id, children_id, children_level
    OF topic_children
    WHERE children_id = temp_topic_id);

    temp_children_level: = temp_children_level - 1;
    END LOOP;

    OPEN FOR Topic_hierarchy_details_out
    Select * from topic_child;

    END P_PARENT_TREE;

    END TOPIC_PKG;

    --------------------------------------------------------------------------------------------------------------------------------------------

    the error "PLS-00103: encountered the symbol"CREATE"when expec...
    no idea why? or can be is there another way to write this query

    Can you post some examples of data? And the expected results?
    Looks like you can use a hierarchical query (START WITH... CONNECT BY), and that you do not have a Temp table (like I said before very rare in Oracle)

  • PLS-00103: encountered the symbol "PREPARE" when expecting one of the following conditions:

    Hello

    Clearly, I'm doing a basic error.

    It is my statement prepared;

    Variable identifier;

    EXEC SQL PREPARE sql_stmt OF ' SELECT order_name, order_status OF orders WHERE order_id <: id; »

    I get the error on execution of the file using @/dir/file.sql

    PLS-00103: encountered the symbol "PREPARE" when awaits an of the

    Next:

    What is the problem?

    concerning

    Sameer

    Yes. You are right. A thorough SQL more guide and modified the SQL for this

    Variable identification number

    VARIABLE order_info REFCURSOR

    Begin

    : id: = 20000;

    Open: order_info to SELECT order_name, order_status OF orders WHERE order_id<>

    End;

    It works fine when it is called from the @/file/file.sql command prompt

    then I print command line order_info

    Thank you

    Sameer

  • Error (34.2): PLS-00103: encountered the symbol "END" when you try to compile the procedure.

    Hello

    I get the following error when I try to compile the procedure. I call a package inside this simple procedure. Not sure where I do worng. Here is the error I get.

    Error (34.2): PLS-00103: encountered the symbol "END"?

    Here is my code

    create or replace PROCEDURE BATCH_JOB_CAC_SP

    (

    vstatus OUT NUMBER)

    AS

    vloadserver global_name.global_name%TYPE: = get_dbservername;

    vuseridmod CONSTANT VARCHAR2 (15): = 'SYSTEM '.

    vloadname CONSTANT VARCHAR2 (30): = "BATCH_JOB_CAC_SP";

    v_cnt_upd NUMBER: = 0;

    vrunid NUMBER;

    v_spoutput VARCHAR2 (150);

    CURSOR job_cac

    IS

    SELECT NumCli, job_cac FROM batch_job_cac, batch_recid, jobnum;

    BEGIN

    I'm in job_cac LOOP

    job_cac_pkg.job_cac_valid_sp (i.custnum, i.jobnum, v_spoutput);

    CASE v_spoutput

    WHEN "1" THEN DBMS_OUTPUT. Put_line ('update job ACC');

    WHEN "2" THEN DBMS_OUTPUT. Put_line ('update job ACC');

    WHEN '3' THEN DBMS_OUTPUT. Put_line ('can not update working ACC');

    OF ANOTHER DBMS_OUTPUT. Put_line (v_spoutput);

    END CASE;

    END LOOP;

    EXCEPTION

    WHILE OTHERS THEN

    IF job_cac % isopen THEN

    CLOSE Job_cac;

    END IF;

    ROLLBACK;

    vStatus: = 1;

    LOG_ERROR_SP_NM (vLoadServer, vLoadName, SQLCODE, SQLERRM, vUserIdMod);

    END;

    END BATCH_JOB_CAC_SP;

    Thanks for your help.

    Hello

    You have 2 statements END at the bottom of your code, but only 1 BEGIN statement earlier.

    Losing one of these END States.

  • get the structure of the event inside the while loop to wait for event occurs before the execution

    Hello

    I have a small problem, when I raise an event using a value change button, which works very well.  The problem is that the VI does not wait for me raise an event and instead runs the same event again, even if I have not pressed the button to start again.  The mechanical action of the button switch is released is.

    I was wondering how you get the structure of the event to wait for a user event, after that he executed the first time.

    James.Morris wrote:

    There is no reason that the event should be raised twice as much that the only way that it fires in your code is by the user by clicking on 'Hall measure only'.

    Oh yes, there is, and I deserve a kudo for this one.  Mechanical action on the button is set on the switch until published, so click to generate an event, on the bottom and on the square, attached is an example.

    My boy has my students hate this question, and to be honest, I hated it.  When never would you do that intentionally?  Honestly?  Anyway to change the button back to normal (as default latch when released) and move the terminal button in the structure of the event where it is managed and it will work as usual.

  • Creation function Interior package Error (15,3): PLS-00103: encountered the symbol ";" when expecting one of the following values: back

    Hello

    I am trying to create a function inside the packaging.

    In the Package BODY I've defined the function, but in the definition of the package, it gives me syntax errors.

    • Error (15,3): PLS-00103: encountered the symbol ";" when expecting one of the following values: back
    • Error (39.1): PLS-00103: encountered the symbol "END" when waiting for one of the following values: start the function pragma procedure subtype type current cursor removal exist prior

    What can I do wrong here.

    Thank you

    Ken

    Inner package BODY:

    / * FUNCTION to form the query * /.

    FUNCTION UDF_FORMQUERY)

    IN_CASEID VARCHAR2,

    IN_SRCLYR VARCHAR2,

    IN_SRC_CONDN VARCHAR2

    )

    RETURN VARCHAR2

    AS

    varSQLQuery VARCHAR2 (10000);

    BEGIN

    varSQLQuery: = "test query";

    RETURN varSQLQuery;

    DBMS_OUTPUT. Put_line (varSQLQuery);

    END UDF_FORMQUERY;

    Definition of package inside:

    create or replace PACKAGE BODY MY_SQUERY

    AS

    FUNCTION UDF_FORMQUERY)

    IN_CASEID VARCHAR2,

    IN_SRCLYR VARCHAR2,

    VARCHAR2 IN_SRC_CONDN( )

    RETURN VARCHAR2

    AS varSQLQuery VARCHAR2 (10000);

    END MY_SQUERY;

    your package definition is incorrect, you have included the part of the declaration of the variables of the function in the package definition. It should be like

    FUNCTION UDF_FORMQUERY)

    IN_CASEID VARCHAR2,

    IN_SRCLYR VARCHAR2,

    IN_SRC_CONDN VARCHAR2)

    RETURN VARCHAR2;

  • PLS-00103: encountered the symbol "PROCÉDURE" when expected

    Hi all

    LINE/COL ERROR

    -------- -----------------------------------------------------------------

    13/5 PLS-00103: encountered the symbol "BEGIN" when expecting one of

    What follows:

    language

    22/4 PLS-00103: encountered the symbol "PROCÉDURE" when expected

    of the following:

    not end up dominant static of final instantiable order pragma

    manufacturer membership card

    The symbol "static" was substituted for "PROCEDURE continue.

    create or replace package xx_extract
    as
    procedure xxc_process;
    procedure xxc_get(in_id     emp.empno%type,
                      in_number emp.deptno%type);
    end ;
    

    create or replace package xx_extract
    as
    cursor v_cursor
    is
    select empno,deptno
      from emp a,dept d
     where e.deptno=d.deptno;
     v_cursor_rec  v_cursor%rowtype;
     v_in_number emp.empno%type;
     v_in_date   emp.hiredate%type;
       procedure xxc_process 
       is
        Begin
            xxc_get(v_cursor_rec.empno,v_cursor_rec.deptno);
             open v_cursor;
           loop
             fetch v_cursor into v_cursor_rec;
             exit when v_cursor%notfound;
           end loop;
        close v_cursor;
       end xxc_process;
       procedure xxc_get(in_id     emp.empno%type,
                         in_number emp.deptno%type)
       is
        begin
         select empno,hiredate
            into v_in_number,v_in_date
           from emp
          where empno=to_char(in_id)
            and deptno=to_char(in_number);
          EXCEPTION
              WHEN NO_DATA_FOUND THEN
                      in_id := NULL;
                      in_number := NULL;
       end xxc_get;
    end xx_extract;
    

    994122 wrote:

    The code below displays all values where I called the procedure before the stmt Open why? Can u please explain.

    PROCEDURE xxc_process

    IS

    BEGIN

    xxc_get (v_cursor_rec.empno, v_cursor_rec.deptno);

    OPEN v_cursor;

    because v_cursor_rec.empno and v_cursor_rec.deptno are empty at this time

    994122 wrote:

    But as suggested as Roger why we named as below? I need the output when I ran the package and I don't want to call (run) as below

    Start

    xx_extract.xxc_process ();

    end;

    the begin... end; box IS running the package, what you do with the create command are CREATION (storage) a package.

  • PLS-00103: encountered the symbol "ALTER".

    I receive he following error when I run this script

    DECLARE
    vcount NUMBER (1);
    BEGIN
    SELECT count (*) IN the all_col_comments vcount
    WHERE owner = 'myUser' and Table_Name = 'table1' and column_name = 'col1 ';
    IF vcount = 0 THEN
    ALTER TABLE myUser.table1
    ADD (col1 varchar2 (1) DEFAULT ' is NOT NULL);
    END IF
    END;

    Error report:
    ORA-06550: line 7, column 4:
    PLS-00103: encountered the symbol "ALTER" when expecting one of the following conditions:

    (begin case declare exit for goto if loop mod null pragma
    raise return select update while < ID >
    < between double quote delimited identifiers of > < a variable binding > < <
    continue the narrow current delete fetch locking insert open rollback
    savepoint sql set run commit forall fusion pipe purge
    The symbol 'lock has been inserted before "ALTER" to continue.
    ORA-06550: line 8, column 11:
    PLS-00103: encountered the symbol "(" quand attend une deles de valeurs suivantes:) "

    , in
    ORA-06550: line 8, column 47:
    PLS-00103: encountered the symbol "NULL" when expected in the following way:

    as like2 like4 likec between Member submultiset
    06550 00000 - "line %s, column % s:\n%s".
    * Cause: Usually a PL/SQL compilation error.

    There is no need to pack the column names in the TOP, the names of the objects are stored by default at the top of case. Isn't that quoted strings must be upper case, but yes, your last block is basically my second block and will correctly find the column already exists when it is executed a second time. Your original, with tiny strings cited would never return a line fomr the query on the column, so would attempt to add the column each time.

    SQL> select table_name, column_name
      2  from all_tab_columns
      3  where owner = 'ops$oracle' and
      4        table_name = 'table1' and
      5        column_name = 'col1';
    
    no rows selected
    
    SQL> select table_name, column_name
      2  from all_tab_columns
      3  where owner = 'OPS$ORACLE' and
      4        table_name = 'TABLE1' and
      5        column_name = 'COL1';
    
    TABLE_NAME                     COLUMN_NAME
    ------------------------------ ------------------------------
    TABLE1                         COL1
    

    See the difference?

    (I only did the drop table so that I can redo the pl/sql block from scratch to show that was) the first time he ran he added the column and b) for subsequent executions, he did not attempt to add the column because it exists, unlike your first display.

    However, scripts that add columns to tables should, in general, not be something that is executed repeatedly. More often by adding a column to a table would be part of a process of controlled upgrade, and most of the time, the fact that a 'new' column already exists in the database before the upgrade seems to indicate a problem with the upgrade process, and probably not something to be ignored in silent mode.

    John

  • PLS-00103: encountered the symbol "VARCHAR2".

    Hi all

    on 11.2.0.4 on Win 2008

    Executing steps I get PLS-00103: encountered the symbol "VARCHAR2":

    DECLARE

    BEGIN

    plsql_block VARCHAR2 (500);

    plsql_block: = ' BEGIN create_dept (:,: b: c: d); END;';

    END;

    /

    ORA-06550: line 3, column 13:

    PLS-00103: encountered the symbol "VARCHAR2" when expecting one of the following conditions:

    := . ( @ % ;

    The symbol ': = ' has been substituted for "VARCHAR2" continue.

    Thank you for helping me see my error.

    Hello

    Variable declaration is declared between the two and start. Personally, I prefer the initialization of variables there.

    DECLARE

    plsql_block VARCHAR2 (40): = ' start create_dept (:,: b: c: d); end;';

    BEGIN

    ...

    You did not request this, but I'm telling you anyway

    I also use declare start the buildings inside the code to make the code more manageable, compact and clear (because I have a short memory, I need to see everything in one small scope at a time). Then, the blocks are easy enough to separate function or procedure if necessary.

    set serveroutput on
    declare
      x number := 0;
    
      procedure step(p1 number) is
      begin
        dbms_output.put_line('Step ' || p1);
      end;
    begin
      step(x);
    
      declare
        y number := x + 1;
      begin
        step(y);
      end;
    
      declare
        z number := x + 2;
      begin
        step(z);
      end;
    
    end;
    /
    
    anonymous block completed
    Step 0
    Step 1
    Step 2
    
  • PLS-00103: encountered the symbol

    Hello
    in 10g R2, what's wrong with my code:
    SQL> DECLARE
      2   my_task_name VARCHAR2(30);
      3   my_sqltext   CLOB;
      4  BEGIN
      5   my_sqltext := 'SELECT m.tablespace_name,        m.used_percent,         (m.tablespace_size - '                      ||
      6                 'm.used_space)*t.block_size/1024/1024 mb_free  FROM  dba_tablespace_usage_metrics m, dba_tablespaces t' ||
      7                 'WHERE :1 != 'BASIC'    AND t.tablespace_name = m.tablespace_name';
      8
      9   my_task_name := DBMS_SQLTUNE.CREATE_TUNING_TASK(
     10           sql_text    => my_sqltext,
     11           bind_list   => sql_binds(anydata.ConvertNumber(100)),
     12           user_name   => 'SCOTT',
     13           scope       => 'COMPREHENSIVE',
     14           time_limit  => 60,
     15           task_name   => 'my_sql_tuning_task',
     16           description => 'Task to tune a query on a specified employee');
     17  END;
     18  /
                   'WHERE :1 != 'BASIC'    AND t.tablespace_name = m.tablespace_name';
                                 *
    ERROR at line 7:
    ORA-06550: line 7, column 30:
    PLS-00103: Encountered the symbol "BASIC" when expecting one of the following:
    * & = - + ; < / > at in is mod remainder not rem
    <an exponent (**)> <> or != or ~= >= <= <> and or like LIKE2_
    LIKE4_ LIKEC_ between || member SUBMULTISET_
    The symbol "* was inserted before "BASIC" to continue.
    Thanks for the help.

    You have a string in quotation marks in a quoted string.

    Whenever you do this, you need to double the inner quotes.

    SQL> select 'where blah != 'BASIC' and' from dual;
    select 'where blah != 'BASIC' and' from dual
                                *
    ERROR at line 1:
    ORA-00923: FROM keyword not found where expected
    
    SQL> select 'where blah != ''BASIC'' and' from dual;
    
    'WHEREBLAH!=''BASIC''AND'
    -------------------------
    where blah != 'BASIC' and
    
  • Getting error PLS-00103: encountered the symbol "MM".

    SQL > create or replace procedure DIP. Insert_proc is

    2 start

    3 immediately execute "INSERT INTO DIP. RAKS (SELECT * FROM DIP.) RAKS WHERE CREATED BETWEEN to_char (TRUNC (ADD_MONTHS (SYSDATE-1), 'MM'), 'YYYYMMDD') AND to_char (TRUNC (LAST_DAY (ADD_MONTHS (SYSDATE-1))), 'YYYYMMDD')); "

    4 run immediately "COMMITTED";

    5 immediately execute "INSERT INTO DIP. RAKS (SELECT * FROM DIP.) RAKS WHERE CREATED BETWEEN to_char (TRUNC (ADD_MONTHS (SYSDATE-1), 'MM'), 'YYYYMMDD') AND to_char (TRUNC (LAST_DAY (ADD_MONTHS (SYSDATE-1))), 'YYYYMMDD')); "

    6 immediate execution "COMMITTED";

    7 end;

    8.

    CAUTION: Procedure created with compilation errors.

    SQL >

    SQL >

    SQL > show error

    DIP PROCEDURAL errors. INSERT_SIV_SELL_PROC:

    LINE/COL ERROR

    -------- -----------------------------------------------------------------

    3/128 PLS-00103: encountered the symbol "MM" when awaits an of the

    Next:

    * & = - + ; <>/ is mod remains not return rem

    return < an exponent (*) > <>or! = or ~ = > = < = <>and or

    as like2 like4 likec between using | bulk of type multiset

    Member submultiset

    SQL >

    any help appreciated.

    CREATE OR REPLACE PROCEDURE DIP. Insert_proc IS

    BEGIN

    immediately execute "INSERT INTO DIP. RAKS (SELECT * FROM DIP.) RAKS WHERE CREATED BETWEEN to_char (TRUNC (ADD_MONTHS (SYSDATE-1), "MM"), "YYYYMMDD") AND to_char (TRUNC (LAST_DAY (ADD_MONTHS (SYSDATE-1))), "YYYYMMDD"))';

    RUN IMMEDIATELY "COMMITTED";

    immediately execute "INSERT INTO DIP. RAKS (SELECT * FROM DIP.) RAKS WHERE CREATED BETWEEN to_char (TRUNC (ADD_MONTHS (SYSDATE-1), "MM"), "YYYYMMDD") AND to_char (TRUNC (LAST_DAY (ADD_MONTHS (SYSDATE-1))), "YYYYMMDD"))';

    run immediately "COMMITTED";

    end;

    /

    Missing semicolon, I modified the last answer but you picked up before it was visible

  • Compilation failure, line 5 (11:02:10) PLS-00103: encountered the symbol "POR".

    I want to send an e-mail message using pl/sql and write the following code, but while compling, error must be occure
    "Failure of compilation, line 5 (11:02:10).
    PLS-00103: encountered the symbol "PortNumber" when expecting one of the following values:; "with authid as order of external assistance cluster parallel_enable deterministic result_cache pipeline."



    create or replace procedure SEND_TEST_EMAIL
    (mailhost IN VARCHAR2 default 'smtp.exchangesetup.com',
    sender VARCHAR2 default '[email protected] '.
    recipient in VARCHAR2 default '[email protected]')
    port_number in default number 25
    )
    is
    BEGIN
    8 mail_conn: = UTL_SMTP. OPEN_CONNECTION (mailhost, 25);
    9 UTL_SMTP. HELO (mail_conn, mailhost);
    10 UTL_SMTP. MAIL (mail_conn, sender);
    11 UTL_SMTP. RCPT (recipient, mail_conn);
    12
    13 UTL_SMTP. OPEN_DATA (mail_conn);
    14 UTL_SMTP. WRITE_DATA (mail_conn, "it is a test message.");
    15 UTL_SMTP. WRITE_DATA (mail_conn, 'It is the 2 line.');
    16 UTL_SMTP. CLOSE_DATA (mail_conn);
    21 UTL_SMTP. Quit (mail_conn);
    22 EXCEPTION
    23 SO THAT OTHERS THEN
    25 NULL;
    26 END;

    NOT TESTED
    Describe below in the part of the statement

    mail_conn UTL_SMTP.CONNECTION;     
    

    as

    CREATE OR REPLACE PROCEDURE SEND_TEST_EMAIL
    (mailhost IN VARCHAR2 DEFAULT 'smtp.exchangesetup.com',
    sender VARCHAR2 DEFAULT '[email protected]',
    recipient IN VARCHAR2 DEFAULT '[email protected]',                               -----code change , removed ')' add ','
    port_number IN NUMBER DEFAULT 25
    )
    IS
    mail_conn UTL_SMTP.CONNECTION;                                                                                   -----code change added mail_conn UTL_SMTP.CONNECTION;
    BEGIN
    mail_conn := UTL_SMTP.OPEN_CONNECTION(mailhost, 25);
    UTL_SMTP.HELO(mail_conn, mailhost);
    UTL_SMTP.MAIL(mail_conn, sender);
     UTL_SMTP.RCPT(mail_conn, recipient);
     UTL_SMTP.OPEN_DATA(mail_conn);
    UTL_SMTP.WRITE_DATA(mail_conn, 'This is a test message.' );
     UTL_SMTP.WRITE_DATA(mail_conn, 'This is line 2.');
     UTL_SMTP.CLOSE_DATA(mail_conn);
     UTL_SMTP.QUIT(mail_conn);
    EXCEPTION
     WHEN OTHERS THEN
     NULL;
     END;
    
  • Encountered the symbol "VARCHAR2"...

    When I try to run under coding in the sql command it shows error
    BEGIN
    APEX_COLLECTION.CREATE_COLLECTION_FROM_QUERY (
        p_collection_name IN VARCHAR2,
        p_query IN VARCHAR2,
        p_generate_md5 IN VARCHAR2 default 'NO');
    END;
    ORA-06550: line 2, column 42: PLS-00103: encountered the symbol "VARCHAR2" when expecting one of the following values:


    (

    1. start
    2 delete_collection (p_collection_name in varchar2);
    3. end;

    Hello

    What are you trying to do here?

    You must pass parameters. You said that if you define a function. i.e.

    begin
      apex_collection.create_collection_from_query(
        p_collection_name => 'SOME VARCHAR2 VALUE',
        p_query => 'select * from dual',
        p_generate_md5 => 'NO');
    end;
    
    begin
      delete_collection(p_collection_name => 'SOME VARCHAR2 VALUE');
    end;
    
  • Error: PLS-00103: encountered the symbol 'COLLECT' during the waited in the following way:. (, limiting the symbol)

    Hi all

    I get this error:

    • Error (55,45): PLS-00103: encountered the symbol 'COLLECT' during the waited in the following way:. (, limiting the symbol ".") has been inserted before 'COLLECT' to continue.

    While trying to create this procedure as below:

    If I run the query, I get the result, but in the procedure, I am trying to convert the OUT_REFCURSOR in a table, but this error.

    PROCEDURE SP_GETVALIDATE)

    IN_CASEID IN VARCHAR2,

    IN_REQID IN VARCHAR2,

    OUT_REFCURSOR ON SYS_REFCURSOR)

    AS

    IS OF TYPE RECORDTYPE

    RECORD (COL1, COL2 VARCHAR2 VARCHAR2);

    IS OF TYPE TABLETYPE

    THE REFTABLETYPE TABLE

    INDEX BY PLS_INTEGER;

    BEGIN

    OPEN for SELECT OUT_REFCURSOR c.RCRD_NO, c.STE_NO_TX DE T_LYR_STES c, p of LAND WHERE c.case_id = IN_CASEID AND p.L_NUMBER > 100;

    LOOP

    Look FOR the OUT_REFCURSOR BULK COLLECT outtable;

    WHEN the outtable OUTPUT. COUNT = 0;

    FOR indx IN 1... outtable. COUNTY

    LOOP

    dbms_output.put_line (outtable (indx). ) RCRD_NO);

    END LOOP;

    END LOOP;

    CLOSE OUT_REFCURSOR;

    END SP_GETVALIDATE;

    I could be wrong here.

    any help appreciated.

    Thank you

    Ken

    SEARCH OUT_REFCURSOR BULK COLLECT INTO outtable;

    You've had your BULK COLLECT and the wrong way around

Maybe you are looking for