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

Tags: Database

Similar Questions

  • 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)

  • Error [PLS-00103: encountered the symbol "CREATE"] using PACKAGE

    Hi guys!
    When I compile this package, I get this error:
    PLS-00103: encountered the symbol "CREATE".

    How can I solve this problem?
    The compiled code is below:


    CREATE OR REPLACE
    PACKAGE CAMPO_PACK AS

    TYPE T_CURSOR IS REF CURSOR;

    PROCEDURE DeleteCode (OSDP NUMBER);

    END CAMPO_PACK;
    -body-
    CREATE or REPLACE PACKAGE BODY CAMPO_PACK as

    PROCEDURE DeleteCode(pCod NUMBER) AS
    BEGIN
    DELETE FROM campo
    WHERE cod = OSDP;
    END DeleteCode;

    END CAMPO_PACK;


    Thanks for the help,
    Anderson



    Published by: user8723300 on 08/13/2009 17:03

    Published by: user8723300 on 08/13/2009 17:04

    I use Oracle SQL Developer

    I know very well of this tool.

    The packet header and body are two separate objects and must be compiled separately. I suspect that the package body is somehow have included in package header and Developer SQL tries to compile all of these at once. You must understand how to compile the header first, then the body. Your code compiles if I use sqlplus. I had to first create the table, so I have included a slash (/) after the packet header and the other after that body. The slash tells sql more to run the buffer (in this case, to compile the object).

    SQL> create table campo (cod number);
    
    Table created.
    
    SQL> CREATE OR REPLACE
      2  PACKAGE CAMPO_PACK AS
      3
      4  TYPE T_CURSOR IS REF CURSOR;
      5
      6  PROCEDURE DeleteCode(pCod NUMBER);
      7
      8  END CAMPO_PACK;
      9  /
    
    Package created.
    
    SQL> CREATE OR REPLACE PACKAGE BODY CAMPO_PACK AS
      2
      3  PROCEDURE DeleteCode(pCod NUMBER) AS
      4  BEGIN
      5  DELETE FROM campo
      6  WHERE cod = pcod;
      7  END DeleteCode;
      8
      9  END CAMPO_PACK;
     10  /
    
    Package body created.
    

    If I remove the slash after the package header, sql more trying to compile all this at once, and I get the same error you get:

    SQL> CREATE OR REPLACE
      2  PACKAGE CAMPO_PACK AS
      3
      4  TYPE T_CURSOR IS REF CURSOR;
      5
      6  PROCEDURE DeleteCode(pCod NUMBER);
      7
      8  END CAMPO_PACK;
      9
     10  CREATE OR REPLACE PACKAGE BODY CAMPO_PACK AS
     11
     12  PROCEDURE DeleteCode(pCod NUMBER) AS
     13  BEGIN
     14  DELETE FROM campo
     15  WHERE cod = pcod;
     16  END DeleteCode;
     17
     18  END CAMPO_PACK;
     19  /
    
    Warning: Package created with compilation errors.
    
    SQL> sho err
    Errors for PACKAGE CAMPO_PACK:
    
    LINE/COL ERROR
    -------- -----------------------------------------------------------------
    9/1      PLS-00103: Encountered the symbol "CREATE"
    
  • 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

  • PLS-00103: encountered the symbol "SYS_REFCURSOR" during the expected in the following way:

    Hey Geeks,

    I am trying to execute the procedure from the SQL Developer, but these errors are coming. What can I do wrong here...

    Procedure works fine when I run the compilation and debugging mode. But I need to put later in the c# code.

    SET serveroutput on;

    DECLARE

    OutParam1 to SYS_REFCURSOR;

    OutParam2 ON Varchar;

    BEGIN

    / * Call procedure package * /.

    SPAT_QUERY. SP_VALIDATERULES (9, 'BIS2015001', OutParam1, OutParam2);

    / * Display parameters * /.

    dbms_output.put_line ('OutParam1: ' |) OutParam2);

    END;

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

    Error report-

    ORA-06550: line 3, column 20:

    PLS-00103: encountered the symbol "SYS_REFCURSOR" during the expected in the following way:

    := . (@ %; not null default range character)

    06550 00000 - "line %s, column % s:\n%s".

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

    -Procedure below:

    create or replace PACKAGE SPAT_QUERY of BODY

    AS

    / * Declare a global variable to hold the result of the Validation. */

    valResult varchar (10);

    PROCEDURE SP_VALIDATERULES)

    IN_RQST_NUM NUMBER,

    IN_CASEID IN VARCHAR,

    OUT_REFCURSOR ON SYS_REFCURSOR,

    OUT_VAL_RSLT ON VARCHAR

    )

    AS

    p_rc sys_refcursor;

    I have NUMBER: = 0;

    / * Logical query - a loop in the Table of RULES based on request NUM * /.

    BEGIN

    FOR rec IN (SELECT * FROM T_RULES where RQST_NUM = IN_RQST_NUM)

    LOOP

    i: = i + 1;

    SP_GETSECTS (IN_CASEID, rec. LYR_TX, rec. TRGT_TX, rec. EXCPTD_RSLT_CD, p_rc);

    OUT_VAL_RSLT: = valResult;

    END LOOP;

    END SP_VALIDATERULES;

    Thank you

    Ken

    in anonymous block, variables cannot be defined in the form. IN and OUR are not variable parameters type

    Change your code to

    DECLARE

    OutParam1 SYS_REFCURSOR;

    OutParam2 Varchar;

  • 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;

  • 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.

  • Error (8.3): PLS-00103: encountered the symbol "END".

    Migration to CREATE or REPLACE PACKAGE
    IS
    PROCEDURE load_staging_tables;
    Migration of the END;
    /

    Migration to CREATE or REPLACE PACKAGE BODY
    IS
    PROCEDURE load_staging_tables
    IS
    Date of LAST_CREATE_DATE;
    BEGIN
    LAST_CREATE_DATE: = max (migrate_load_dt) select mgur;
    END load_staging_tables;

    Migration of the END;
    /

    The following error is received:
    Error (8.3): PLS-00103: encountered the symbol "END".

    running in 11 g using sql developer.


    Which is wrong with the script?

    You cannot assign your select statement directly to a variable. You can use an INTO clause in your select statement.

    CREATE OR REPLACE PACKAGE BODY migration IS
      PROCEDURE load_staging_tables IS
        LAST_CREATE_DATE date;
      BEGIN
        --LAST_CREATE_DATE := select max(migrate_load_dt) from mgur;
        select max(migrate_load_dt)
          into LAST_CREATE_DATE
          from mgur;
      END load_staging_tables;
    END migration;
    
  • 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 "ACCEPT" in sql * most report

    Hello

    SQL > @Testing.SQL

    Please enter the Deptno: 30

    ACCEPT v_FROM_Date PROMPT ' Please enter the Date(In Format: DD-MON-YYYY) start: '

    *

    ERROR on line 5:

    ORA-06550: line 5, column 1:

    PLS-00103: encountered the symbol "ACCEPT."

    Clear Buffer;
    
    
    SET Heading ON
    SET Verify OFF
    SET Feed OFF
    SET Linesize 5000
    SET Pagesize 2000
    SET Serveroutput ON SIZE 1000000
    
    
    VARIABLE        v_FROM_Date       VARCHAR2(200);
    VARIABLE        v_deptno       NUMBER;
    
    
    Spool Details.txt;
    
    
    --PROMPT Please enter the Deptno: &&v_deptno
    --PROMPT Please enter the Start Date(In Format: DD-MON-YYYY): &&v_From_Date
    ACCEPT v_deptno PROMPT 'Please enter the Deptno: '
    
    
    BEGIN
        :v_deptno := UPPER(NVL(RTRIM(LTRIM('&v_deptno')),0));
    END;
    
    
    ACCEPT v_FROM_Date PROMPT 'Please enter the Start Date(In Format: DD-MON-YYYY): '
    
    
    BEGIN
        :v_From_Date := TO_DATE('&v_From_Date','DD-MON-YYYY');
    END;
    
    
    select empno,ename,sal,hiredate,deptno
    from emp
    where deptno=:v_deptno
    and to_date(hiredate,'DD-MON-YYYY')=:v_From_Date
    /
    
    
    SPOOL OFF;
    

    Thank you

    Rajesh123 wrote:

    1. VARIABLE v_deptno NUMBER;
    2. BEGIN
    3. : v_deptno: = UPPER (NVL (RTRIM (LTRIM ('& v_deptno')), 0));
    4. END;

    Thank you

    The v_deptno variable above is a number data type. So no need to use UPPER LTRIM, RTRIM, functions and why are you using NVL(v_deptno,0)? DeptNo 0 is present in the emp table? If Yes, you can use NVL with 0, otherwise just use any other deptno which is present in the table emp with NVL function.

    Rajesh123 wrote:

    1. Select empno, ename, sal, hiredate deptno
    2. WCP
    3. where deptno =: v_deptno
    4. and to_date (hiredate,'MON-DD-YYYY "") =: v_From_Date
    5. /

    Thank you

    HireDate is already a date data type to the emp table then why you try to convert a date once again. Delete this.

    Check the code of work after all the applied corrections that are not above below.

    Buffer Clear;

    SET the position WE

    SET verify OFF

    SET to power OFF

    SET Linesize 5000

    SET Pagesize 2000

    SET Serveroutput ON SIZE 1000000

    V_FROM_Date VARIABLE VARCHAR2 (200);

    VARIABLE v_deptno NUMBER;

    Reel 'D:\Details.txt ';

    -PROMPT please enter the Deptno: & v_deptno

    -PROMPT please enter the Date(In Format: DD-MON-YYYY) start: & v_From_Date

    ACCEPT v_deptno PROMPT ' Please enter the Deptno: '

    ACCEPT v_FROM_Date PROMPT ' Please enter the Date(In Format: DD-MON-YYYY) start: '

    BEGIN

    : v_deptno: = '& v_deptno ';. -If necessary use NVL ("& v_deptno", 10 (which is present in the emp table))

    : v_From_Date: = '& v_From_Date ';.

    END;

    /

    Select empno, ename, sal, hiredate deptno

    WCP

    where deptno =: v_deptno

    and hiredate = TO_DATE(:v_From_Date,'DD-MON-YYYY');

    /

    SPOOL OFF;

    -Edited as suggested by ascheffer

    Thank you

    Ann

  • ORA-06550 pls-00103 encountered the end symbol of file

    HII

    the procedure below compiles well.

    CREATE OR REPLACE PROCEDURE BG. FIND_DUP (EMP_CODE NUMBER, MAIN_EMP_CODE NUMBER) IS

    CURSOR C1 IS

    SELECT THE TABLE TABLE_NAME FROM USER_TAB_COLUMNS

    WHERE COLUMN_NAME = 'EMP_CODE. '

    AND UPPER (TABLE_NAME) <>UPPER ('PA_EMP_MERGE');

    V_T_NAME VARCHAR2 (2000);

    RESULT VARCHAR2 (1000);

    BEGIN

    OPEN C1;

    LOOP

    FETCH C1 IN V_T_NAME;

    WHEN EXIT C1% NOTFOUND;

    RESULT: = 'UPDATE'. V_T_NAME | ' SET EMP_CODE =' | EMP_CODE | "WHERE EMP_CODE =' | MAIN_EMP_CODE | « ; » ;

    RUN THE IMMEDIATE RESULT.

    END LOOP;

    CLOSE C1;

    END;

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

    but when I try to run it gives me

    ORA-06550: line 1, column 26:

    PLS-00103: encountered the symbol "end-of-file" during the expected in the following way:

    ; < an ID > < a between double quote delimited identifiers of >

    The symbol ";" was replaced by "end-of-file" continue.

    -Im using oracle 10g

    Hello

    Do not put a semicolon at the end of the dynamic SQL statements.

    Instead of:

    RESULT: =... | MAIN_EMP_CODE | ';';

    Try:

    RESULT: =... | MAIN_EMP_CODE;

    You need a semicolon (outside the single quotes) to put an end to the assignment statement, but you don't need a semicolon (inside the single quotes) to put an end to the dynamic UPDATE statement.

    Whenever you make dynamic SQL code, ask someone (often yourself) "Is this really necessary?"

    Dynamic SQL is usually an accessory to the wrong table design.  Do you really need to have several tables that each must be updated in the same way, at the same time?  Are you create new tables so frequently that cannot keep track of their static code?

  • 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 "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

  • PLS-00103: encountered the symbol "end-of-file.

    Hello
    on the 11g R2, I get the following error:
    SQL> declare
      2      m_clob  clob;
      3  begin
      4      select
      5          sql_fulltext
      6      into
      7          m_clob
      8      from
      9          v$sql
     10      where
     11          sql_id = '0cx8yq5fnry'
     12      and child_number = 0
     13      ;
     14
     15      dbms_output.put_line(m_clob);
     16    /
        dbms_output.put_line(m_clob);
                                    *
    ERROR at line 15:
    ORA-06550: line 15, column 33:
    PLS-00103: Encountered the symbol "end-of-file" when expecting one of the
    following:
    ( begin case declare end exception exit for goto if loop mod
    null pragma raise return select update while with
    <an identifier> <a double-quoted delimited-identifier>
    <a bind variable> << continue close current delete fetch lock
    insert open rollback savepoint set sql execute commit forall
    merge pipe purge
    Thanks for help.

    Start
    do something;
    END;
    */*

  • 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;
    

Maybe you are looking for

  • ID blocked apple iPhone

    Hello! My Iphone 4S icloud address is blocked. ************ I remember my icloud password before ********** After reset of that my password is ************* Please unlock my icloud account to use my phone I have attached my passport id and phone box

  • How to stop ads?

    For these last days every 5-20 minutes a new window appears for Firefox with an ad for a game, a website, porn or other stuff at random, and I do not know what is the cause. I tried to block each copy URL here, but it doesn't seem to work. I have pop

  • Can't install nvidia 8800gt video card

    OK, here we go. I replaced a motherboard in a dell xps 630i When I install vista video card drivers freezes black screen once the green bars go and will not start. I can boot into safe mode If I go into Device Manager, it shows the drivers installed

  • OSPF on IPSEC?

    Hi guys,. Can I run ospf based IPSEC? (No WILL).

  • Group of channels on 2 switches

    I have 2 24-port Catalyst 3560 switches (call them, one switch and switch-b).  They are connected together by a cable connection and not stacked (the c3750 is stackable but not the c3560). Is it possible to have a group of ports-channels with 2 ports