package with error pls-00103.

Hello all;

I was wondering if you can help me understand why I get an error pls-003. Also, how you include a blank space in a where in the statement. Thanks for the help
Something similar to this where in ('  ')
See the package below
create or replace package NEW_INFORMATION is


function total_number return number;
procedure daily_tasks;




  
end NEW_INFORMATION;
See the below package body
create or replace package body NEW_INFORMATION  is
-----------------------------------------------------------------------------------------------------
function total_number return number is

oput number(10);

begin

  select count(unique (p1.user_id)) into oput
  from table_one p1 where p1.user_id in 
    ('JOHN', 'PAIR', '      ');

 return oput;
end; 
-----------------------------------------------------------------------------------------------------


procedure daily_tasks is
  
name_p_id varchar2(20);
temp_num number(6,2);

temp_num :=  total_number(); --used to call the above function 


begin
  

end daily_tasks ;
end NEW_INFORMATION;

Hello

Whenever you have a question about an error message, it helps if you post the full error message, including line numbers.

In the package body, you must:

procedure daily_tasks is

     name_p_id     varchar2(20);
     temp_num      number(6,2);

     temp_num :=  total_number(); --used to call the above function 

begin
...

The statement

     temp_num :=  total_number(); --used to call the above function 

would be good after the BEGIN statement, but not in front of him, in the declaration section.
If you declare and initialize temp_num at the same time, you can say:

temp_num   number (6,2) := total_number;

Given that you call total_number without argument, the parnetheses are optional.

The condition

where p1.user_id in  ('JOHN', 'PAIR', '      ');

is syntactically correct. It will result in the rows being counted when user_id is one of the following:
(a) the 4 characters strring 'J', 'o', 'H', ' don't
(b) the 4 characters strring 'P', 'A', 'I', 'R', or
(c) the 6-character string '',' ', ' ', ' ', '',' ' (in other words, 6 characters)

If this isn't what you want, post a small example of data for table_one (CREATE TABLE and INSERT statements) and the results desired from these sample data.

Tags: Database

Similar Questions

  • Get the error PLS-00103 while specifying the Type of package

    Hey bud,
    All by specifying a Type which is the table of a different type, in the same package, I get an error in my PL Sql Developer, saying:


    Errors of compilation for the OASIS_TST PACKAGE. PK_OA
    Error: PLS-00103: encountered the symbol "TABLE" when awaits one of the following values:
    opaque object
    Line: 61
    Text: as a table of tp_report;

    Here are the specs of my package where the respective Types are declared:

    ************************************************************************
    create or replace package pk_oa
    is
    function (report)
    as in pd_date)
    return tp_tab in pipeline;

    type tp_report
    as an object
    *(*
    ID INT,
    last_nm VARCHAR2 (50).
    first_nm VARCHAR2 (50).
    full_nm VARCHAR2 (50));

    type tp_tab
    as the table of tp_report;

    end;
    **************************************************************
    Could you find where I'm wrong with this piece.
    Thank you

    HP

    You must create types of objects outside packages:

    SQL> create or replace type tp_report
      2  as object(
      3     id INT,
      4     last_nm VARCHAR2(50),
      5     first_nm VARCHAR2(50),
      6     full_nm VARCHAR2(50));
      7  /
    
    Typ wurde erstellt.
    
    SQL> create or replace package pk_oa
      2  is
      3
      4  type tp_tab
      5  is table of tp_report;
      6
      7  function report (
      8  pd_date in date)
      9  return tp_tab pipelined;
     10
     11  end;
     12  /
    
    Package wurde erstellt.
    

    URS

  • 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"
    
  • Why I got error PLS-00103 for this procedure?

    Hey, guys:

    I have a question about the syntax of the exception, I want to record the number of rows from the tables, but if there is no such thing as a table, my program must be able to continue the loop.
    create or replace procedure check_rows as
    
    
       cursor t1 is select table_name from all_csv
                 where table_built='Y'
                 and table_name is not null;
    
      match_count1 INTEGER;
      
    begin
    
       for n in t1 loop
       
          dbms_output.put_line(n.table_name);
          EXECUTE IMMEDIATE 'SELECT COUNT(*) FROM ' || n.table_name INTO match_count1 ;
    
          
          update all_csv
          set total_rows=match_count1
          where table_name=n.table_name;
          
          exception when table_does_not_exist then null end;  
    
       end loop;
       
       commit;
    
    end;
    I'm your only syntax error:


    PLS-00103: encountered the symbol "EXCEPTION" when expected
    of the following:
    begin case declare end exit for goto if loop mod null pragma
    raise return select update while < ID >
    < between double quote delimited identifiers of > < a variable binding > < <
    Close current delete fetch locking insert open rollback
    SAVEPOINT SQLExecute set pipe fusion commit forall

    Could someone give me a hint?

    Thank you very much!

    Sam

    EXCEPTION clause should be at the end of the BEGIN block. It cannot start in the middle of the lock begin body:

    create or replace
      procedure check_rows
        as
            cursor t1
              is
                select  table_name
                  from  all_csv
                  where table_built='Y'
                    and table_name is not null;
            match_count1 INTEGER;
        begin
            for n in t1 loop
              begin
                  dbms_output.put_line(n.table_name);
                  EXECUTE IMMEDIATE 'SELECT COUNT(*) FROM ' || n.table_name INTO match_count1;
                  update  all_csv
                     set  total_rows = match_count1
                    where table_name = n.table_name;
                exception
                  when table_does_not_exist then null;
              end;
            end loop;
       commit;
    end;
    /
    

    And it is not a good idea to engage in the stored procedure. But the main question here is table_does_not_exist exception because it is not declared in your code. You must declare it and use PRAGMA EXCEPTION_INIT to connect with the desired error code.

    SY.

  • Error PLS-00103 and the program has stopped responding

    Hey all, I am currently practical with pl/sql, I am a beginner trying to pl/sql self-training, I use the HR schema that accompanies the express edition of oracle 10g for practice, here is my code:

    -- -------------------------------------------------------------------------------------------
    FUNCTION to CREATE or REPLACE checkIfSalaryExceedMin (currentJobID in NUMBER, currentProposedSalary number)
    RETURN BOOLEAN IS

    minSalary NUMBER: = 0;

    Begin

    Select j.min_salary FROM minSalary of JOB j where j.job_id = currentJobID;

    RETURN currentProposedSalary > minSalary;

    End checkIfSalaryExceedMin;
    -- -------------------------------------------------------------------------------------------
    -- -------------------------------------------------------------------------------------------
    FUNCTION to CREATE or REPLACE checkForJobChange (currentEmpID in NUMBER, currentEmpStartDate IN DATE)
    RETURN BOOLEAN IS

    CURSOR emp_date_id_list1 IS (Select j1.start_date, e1.employee_id JOB_HISTORY j1 EMPLOYEES JOIN e1 ON j1.employee_id = e1.employee_id);

    checkVal NUMBER: = 0;

    Begin

    For em1 IN LOOP emp_date_id_list1

    IF (currentEmpID = em1.employee_id AND currentEmpStartDate! = em1.start_date) THEN
    checkVal: = 1;
    END IF;

    END LOOP;

    IF checkVal = 1 THEN
    RETURN TRUE;
    ELSIF checkVal = 0 THEN
    RETURN FALSE;
    END IF;

    End checkForJobChange;
    -- -------------------------------------------------------------------------------------------
    -- ===================MAIN====================
    Declare

    CURSOR emp_date_id_list IS (Select j.start_date, e.employee_id, e.job_id, e.salary JOB_HISTORY e j EMPLOYEES JOIN ON j.employee_id = e.employee_id);

    Begin

    For em IN emp_date_id_list LOOP

    IF (em.start_date < TO_DATE ('1990-01-01', 'YYYY-MM-DD')) THEN

    IF (checkForJobChange (em.employee_id, em.start_date)) THEN
    IF checkIfSalaryExceedMin (em.job_id, (e.salary + (e.salary*.20))) THEN
    DBMS_OUTPUT. Put_line ('you can increase his salary');
    END IF;
    END IF;

    END IF;

    END LOOP;

    End;

    -- ================END==MAIN==================

    What it does is check if the employee worked prior to January 1, 1990, if he had had a change of job and if it fulfills the two conditions, the program checks if its proposed new salary will be larger than his salary manager current, if not he can get a pay raise.

    So my problem is I got an error PLS-00103 earlier, after some tweaking my program now is insensitive, what am I doing wrong? :(

    Help, please. Thank you.

    checkIfSalaryExceedMin (currentJobID in NUMBER

    Must be:

    checkIfSalaryExceedMin (currentJobID in VARCHAR2

    or:

    checkIfSalaryExceedMin (currentJobID IN employees.job_id%type

    Since then job_id is of data type VARCHAR2 and not a NUMBER.

    Also

    IF checkIfSalaryExceedMin (em.job_id, (e.salary + (e.salary*.20))) THEN

    must be:

    IF checkIfSalaryExceedMin (em.job_id, (em.salary + (em.salary*.20))) THEN

    After some tweaking my program does not

    I've been juggling as well and are unaware of any 'unresponsiveness':

    SQL> declare
      2    cursor emp_date_id_list
      3    is
      4    select j.start_date
      5    ,      e.employee_id
      6    ,      e.job_id
      7    ,      e.salary
      8    from job_history j
      9    join employees e
     10    on j.employee_id = e.employee_id;
     11  begin
     12    for em in emp_date_id_list
     13    loop
     14      if (em.start_date < to_date('1990-01-01', 'YYYY-MM-DD'))
     15      then
     16        if (checkforjobchange(em.employee_id, em.start_date))
     17        then
     18          if checkifsalaryexceedmin(em.job_id, (e.salary + (e.salary * .20)))
     19          then
     20            dbms_output.put_line('You can raise his salary');
     21          end if;
     22        end if;
     23      end if;
     24    end loop;
     25  end;
     26  /
            if checkifsalaryexceedmin(em.job_id, (e.salary + (e.salary * .20)))
                                                  *
    ERROR at line 18:
    ORA-06550: line 18, column 47:
    PLS-00201: identifier 'E.SALARY' must be declared
    ORA-06550: line 18, column 9:
    PL/SQL: Statement ignored
    
    SQL> declare
      2    cursor emp_date_id_list
      3    is
      4    select j.start_date
      5    ,      e.employee_id
      6    ,      e.job_id
      7    ,      e.salary
      8    from job_history j
      9    join employees e
     10    on j.employee_id = e.employee_id;
     11  begin
     12    for em in emp_date_id_list
     13    loop
     14      if (em.start_date < to_date('1990-01-01', 'YYYY-MM-DD'))
     15      then
     16        if (checkforjobchange(em.employee_id, em.start_date))
     17        then
     18          if checkifsalaryexceedmin(em.job_id, (em.salary + (em.salary * .20)))
     19          then
     20            dbms_output.put_line('You can raise his salary');
     21          end if;
     22        end if;
     23      end if;
     24    end loop;
     25  end;
     26  /
    declare
    *
    ERROR at line 1:
    ORA-06502: PL/SQL: numeric or value error: character to number conversion error
    ORA-06512: at line 18
    
    SQL> create or replace function checkifsalaryexceedmin(currentjobid          in employees.job_id%typ
    e
      2                                                   ,currentproposedsalary in number)
      3   return boolean is
      4
      5   minsalary number := 0;
      6
      7  begin
      8
      9   select j.min_salary
     10     into minsalary
     11     from jobs j
     12    where j.job_id = currentjobid;
     13
     14   return currentproposedsalary > minsalary;
     15
     16  end checkifsalaryexceedmin;
     17  /
    
    Function created.
    
    SQL> declare
      2    cursor emp_date_id_list
      3    is
      4    select j.start_date
      5    ,      e.employee_id
      6    ,      e.job_id
      7    ,      e.salary
      8    from job_history j
      9    join employees e
     10    on j.employee_id = e.employee_id;
     11  begin
     12    for em in emp_date_id_list
     13    loop
     14      if (em.start_date < to_date('1990-01-01', 'YYYY-MM-DD'))
     15      then
     16        if (checkforjobchange(em.employee_id, em.start_date))
     17        then
     18          if checkifsalaryexceedmin(em.job_id, (em.salary + (em.salary * .20)))
     19          then
     20            dbms_output.put_line('You can raise his salary');
     21          end if;
     22        end if;
     23      end if;
     24    end loop;
     25  end;
     26  /
    You can raise his salary
    You can raise his salary
    
    PL/SQL procedure successfully completed.
    
  • Trigger error pls-00103

    Hey guys,.
    trying to create a trigger, but I'm getting the error pls-00103 I can't seem to find whats wrong
    can someone help with this at all?

    CREATE OR REPLACE the TRIGGER 'shop_closed_check '.
    before insertion or update of current_status on the shop
    Start
    for each line

    If: new.current_status! = ' 4 - CLOSED"and: old.current_status = '4' - CLOSED
    RAISE_APPLICATION_ERROR ("NUM = >-20000, msg = > ' cannot reopen a closed call");
    on the other
    null;

    end if;
    end shop_closed_check;

    Thanks in advance :)

    Published by: Sally188 on December 7, 2009 06:45

    Try this - no need for quotes for the name of the trigger and for each line won't come before
    If should have one then

    create or replace trigger shop_closed_check
    before insert or update of current_status on shop
    for each row
    begin
    
    if :old.current_status = '4 - CLOSED' then
    RAISE_APPLICATION_ERROR(NUM=>-20000, msg=>'cannot reopen a closed call');
    else
    null;
    
    end if;
    end shop_closed_check;
    
  • 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)

  • 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

  • Error PLS-00103

    can you please tell me what I'm missing. I am getting error below.
    Error(8,12): PLS-00103: Encountered the symbol "C_SEL" when expecting one of the following:     := . ( @ % ; 
    CREATE OR REPLACE PACKAGE BODY "XXDL_PN_LOAD_EMP_ASSIGN_PKG"
    AS
    FUNCTION insert_pn_emp_space_assign
        RETURN NUMBER
    IS
    BEGIN
        CURSOR c_sel  IS --NO RECORDS FOUND
          SELECT room_id ,
            room_scheduler,
            benches,
            lab_type,
            room_num,
            floor_id ,
            DEPARTMENT_NAME ,
            room_eff_from_date ,
            room_eff_to_date ,
            org_id ,
            pi_id ,
            dept_pct ,
            pi_pct ,
            FUNCTIONAL_USE_PCT ,
            RESEARCH_EXPLANATION ,
            SUB_DEPT ,
            FUNCTIONAL_USE_CODE ,
            FUNCTIONAL_USE_DESCRIPTION ,
            COUNT(1)
          FROM XXDL.XXDL_CD_FACILITY k
          WHERE pi_id NOT LIKE 'FMS%'
            --and floor_id ='00'
            --and pi_id='04309605'
          AND room_eff_to_date IS NULL
            -- and room_id ='07-590-02-2134'
          AND room_id NOT IN
            (SELECT location_code
            FROM PN_SPACE_ASSIGN_EMP_V
            WHERE emp_space_assign_id IS NOT NULL
            )
        AND EXISTS
          ( SELECT DISTINCT location_code
          FROM pn_locations_all
          WHERE room_id=location_code
            --and nvl(to_date(room_eff_to_date,'Mon/dd/RRRR'),active_end_date)=active_end_date
          )
        GROUP BY room_id ,
          DEPARTMENT_NAME ,
          room_scheduler,
          benches,
          lab_type,
          room_num,
          floor_id ,
          room_eff_from_date ,
          room_eff_to_date ,
          org_id ,
          pi_id ,
          dept_pct ,
          pi_pct ,
          FUNCTIONAL_USE_PCT ,
          RESEARCH_EXPLANATION ,
          SUB_DEPT ,
          FUNCTIONAL_USE_CODE ,
          FUNCTIONAL_USE_DESCRIPTION
        HAVING COUNT(1)=1 ;
        CURSOR c_conc( p_room_id VARCHAR2 ,p_dept_name VARCHAR2 ,p_piid VARCHAR2 ,p_eff_date VARCHAR2 )
        IS
          SELECT FUNCTIONAL_USE_PCT ATTRIBUTE5 ,
            RESEARCH_EXPLANATION ATTRIBUTE6 ,
            SUB_DEPT ATTRIBUTE7 ,
            dept_pct ATTRIBUTE1 ,
            pi_pct ATTRIBUTE2 ,
            FUNCTIONAL_USE_CODE ATTRIBUTE3 ,
            FUNCTIONAL_USE_DESCRIPTION ATTRIBUTE4
          FROM XXDL.XXDL_CD_FACILITY
          WHERE room_id         =p_room_id
          AND department_name   =p_dept_name
          AND pi_id             =p_piid
          AND 1                 =2------not used
          AND room_eff_to_date IS NULL
            --and to_date(room_eff_to_date,'Mon/dd/RRRR')=to_date(p_eff_date,'Mon/dd/RRRR')
            ;
        
        l_person_id     NUMBER;
        l_location_id   NUMBER;
        l_parent_loc_id NUMBER;
        l_attribute5    VARCHAR2(500);
        l_attribute6    VARCHAR2(500);
        l_attribute7    VARCHAR2(500);
        l_attribute1    VARCHAR2(500);
        l_attribute2    VARCHAR2(500);
        l_attribute3    VARCHAR2(500);
        l_attribute4    VARCHAR2(500);
      BEGIN
           mo_global.set_policy_context('S',84);
        FOR c2 IN c_sel
        LOOP
          l_parent_loc_id:= NULL;
          BEGIN
            SELECT location_id
            INTO l_parent_loc_id -- NO RECORDS RETURNED FROM CURSOR
            FROM pn_locations_all
            WHERE location_alias          = c2.floor_id
            AND location_type_lookup_code ='FLOOR';
          EXCEPTION
          WHEN OTHERS THEN
            l_parent_loc_id:= NULL;
          END;
          l_location_id:= NULL;
          BEGIN
            SELECT location_id
            INTO l_location_id
            FROM pn_locations_all
            WHERE location_code    = c2.room_id
            AND parent_location_id =l_parent_loc_id;
          EXCEPTION
          WHEN OTHERS THEN
            l_location_id:= NULL;
          END;
          l_attribute3:=NULL;
          l_attribute4:=NULL;
          l_attribute5:=NULL;
          l_attribute6:=NULL;
          l_attribute7:=NULL;
          FOR c3      IN c_conc(c2.room_id,c2.department_name,c2.pi_id,c2.room_eff_to_date)
          LOOP
            --
            IF l_attribute5 IS NULL THEN
              l_attribute5  :=c3.attribute3||'.'||c3.attribute5;
            ELSE
              IF c3.attribute5 IS NOT NULL THEN
                l_attribute5   :=l_attribute5||','||c3.attribute3||'.'||c3.attribute5;
              END IF;
            END IF;
            --
            IF l_attribute6    IS NULL THEN
              IF c3.attribute6 IS NOT NULL THEN
                l_attribute6   :=c3.attribute3||'.'||c3.attribute6;
              END IF;
            ELSE
              IF c3.attribute6 IS NOT NULL THEN
                l_attribute6   :=l_attribute6||','||c3.attribute3||'.'||c3.attribute6;
              END IF;
            END IF;
            IF l_attribute7    IS NULL THEN
              IF c3.attribute7 IS NOT NULL THEN
                l_attribute7   :=c3.attribute3||'.'||c3.attribute7;
              END IF;
            ELSE
              IF c3.attribute7 IS NOT NULL THEN
                l_attribute7   :=l_attribute7||','||c3.attribute3||'.'||c3.attribute7;
              END IF;
            END IF;
            --functional code
            IF l_attribute3 IS NULL THEN
              l_attribute3  :=c3.attribute3;
            ELSE
              IF c3.attribute3 IS NOT NULL THEN
                l_attribute3   :=l_attribute3||','||c3.attribute3;
              END IF;
            END IF;
            --functional desc
            IF l_attribute4 IS NULL THEN
              l_attribute4  :=c3.attribute4;
            ELSE
              IF c3.attribute4 IS NOT NULL THEN
                l_attribute4   :=l_attribute4||','||c3.attribute4;
              END IF;
            END IF;
          END LOOP;
          l_person_id:=NULL;
          BEGIN
            SELECT person_id
            INTO l_person_id
            FROM per_all_people_f
            WHERE employee_number=c2.pi_id
            AND sysdate BETWEEN effective_start_date AND effective_end_date ;
          EXCEPTION
          WHEN OTHERS THEN
            l_person_id:=NULL;
          END;
        insert into PN_EMP_SPACE_ASSIGN_ITF
                                          (
                                          BATCH_NAME                                 
                                          ,ENTRY_TYPE                                 
                                          ,EMP_SPACE_ASSIGN_ID                                
                                          ,LOCATION_ID                                        
                                          ,EMPLOYEE_ID                                        
                                          ,COST_CENTER_CODE                                   
                                          ,ALLOCATED_AREA                                     
                                          ,LAST_UPDATE_DATE                           
                                          ,LAST_UPDATE_LOGIN                                  
                                          ,CREATED_BY                                 
                                          ,CREATION_DATE                              
                                          ,LAST_UPDATED_BY                            
                                          ,ATTRIBUTE_CATEGORY                                 
                                          ,ATTRIBUTE1                                         
                                          ,ATTRIBUTE2                                         
                                          ,ATTRIBUTE3                                         
                                          ,ATTRIBUTE4                                         
                                          ,ATTRIBUTE5                                         
                                          ,ATTRIBUTE6                                         
                                          ,ATTRIBUTE7                                         
                                          ,ATTRIBUTE8                                         
                                          ,ATTRIBUTE9                                         
                                          ,ATTRIBUTE10                                        
                                          ,ATTRIBUTE11                                        
                                          ,ATTRIBUTE12                                        
                                          ,ATTRIBUTE13                                        
                                          ,ATTRIBUTE14                                        
                                          ,ATTRIBUTE15                                        
                                          ,TRANSFERRED_TO_CAD                                 
                                          ,TRANSFERRED_TO_PN                                  
                                          ,ERROR_MESSAGE                                      
                                          ,SOURCE                                             
                                          ,REQUEST_ID                                         
                                          ,PROGRAM_APPLICATION_ID                             
                                          ,PROGRAM_ID                                         
                                          ,PROGRAM_UPDATE_DATE                                
                                          ,EMP_ASSIGN_START_DATE                              
                                          ,EMP_ASSIGN_END_DATE                                
                                          ,UTILIZED_AREA                                      
                                          ,CHANGE_DATE                                        
                                          ,CHANGE_MODE                                        
                                          ,PROJECT_ID                                         
                                          ,TASK_ID                                            
                                          ) 
                                  values--custom table columns
                                          (     
                                          '07-590_floor_bulk_spc' --BATCH_NAME                                 
                                          ,'A' --ENTRY_TYPE                                 
                                          ,PN_SPACE_ASSIGN_EMP_S.nextval --EMP_SPACE_ASSIGN_ID                                
                                          ,l_location_id --LOCATION_ID                                        
                                          ,l_person_id --EMPLOYEE_ID                                        
                                          ,1028389 --COST_CENTER_CODE                                   
                                          ,0 --ALLOCATED_AREA                                     
                                          ,sysdate --LAST_UPDATE_DATE                           
                                          ,157092 --LAST_UPDATE_LOGIN                                  
                                          ,157092 --CREATED_BY                                 
                                          ,sysdate --CREATION_DATE                              
                                          ,157092 --LAST_UPDATED_BY                            
                                          ,null --ATTRIBUTE_CATEGORY                                 
                                          ,c2.dept_pct --ATTRIBUTE1                                         
                                          ,c2.pi_pct --ATTRIBUTE2                                         
                                          ,C2.FUNCTIONAL_USE_CODE --ATTRIBUTE3                                         
                                          ,C2.FUNCTIONAL_USE_DESCRIPTION  --ATTRIBUTE4                                         
                                          ,C2.FUNCTIONAL_USE_PCT  --ATTRIBUTE5                                         
                                          ,C2.RESEARCH_EXPLANATION --ATTRIBUTE6                                         
                                          ,C2.SUB_DEPT --ATTRIBUTE7                                         
                                          ,null --ATTRIBUTE8                                         
                                          ,null --ATTRIBUTE9                                         
                                          ,null --ATTRIBUTE10                                        
                                          ,c2.ORG_Id||'-'||c2.DEPARTMENT_NAME --ATTRIBUTE11                                        
                                          ,null --ATTRIBUTE12                                        
                                          ,null --ATTRIBUTE13                                        
                                          ,null --ATTRIBUTE14                                        
                                          ,null --ATTRIBUTE15                                        
                                          ,null --TRANSFERRED_TO_CAD                                 
                                          ,null --TRANSFERRED_TO_PN                                  
                                          ,null --ERROR_MESSAGE                                      
                                          ,'TST' --SOURCE                                             
                                          ,null --REQUEST_ID                                         
                                          ,null --PROGRAM_APPLICATION_ID                             
                                          ,null --PROGRAM_ID                                         
                                          ,null --PROGRAM_UPDATE_DATE                                
                                          ,to_date(c2.room_eff_from_date,'mon/dd/RRRR') --EMP_ASSIGN_START_DATE                              
                                          ,to_date(c2.room_eff_to_date,'mon/dd/RRRR')  --EMP_ASSIGN_END_DATE                                
                                          ,null --UTILIZED_AREA                                      
                                          ,null --CHANGE_DATE                                        
                                          ,null --CHANGE_MODE                                        
                                          ,null --PROJECT_ID                                         
                                          ,null --TASK_ID   --07-590-02-ELEV02
                                          );
    
        END LOOP;
      RETURN 1;
    EXCEPTION
           WHEN OTHERS THEN
               FND_FILE.PUT_LINE(FND_FILE.LOG,'Error while insert_pn_emp_space_assign - '||sqlerrm);
                  RETURN 0;
            END;
          WHEN OTHERS THEN
            FND_FILE.PUT_LINE(FND_FILE.LOG,'Error while insert_pn_emp_space_assign - '||sqlerrm);
            RETURN 0;
      END insert_pn_emp_space_assign;
      END XXDL_PN_LOAD_EMP_ASSIGN_PKG;

    893185 wrote:
    can you please tell me what I'm missing. I am getting error below.

    Error(8,12): PLS-00103: Encountered the symbol "C_SEL" when expecting one of the following:     := . ( @ % ; 
    
    CREATE OR REPLACE PACKAGE BODY "XXDL_PN_LOAD_EMP_ASSIGN_PKG"
    AS
    FUNCTION insert_pn_emp_space_assign
    RETURN NUMBER
    IS
    BEGIN
    

    delete 'START' of the previous line

  • Try to run the procedure and get an error PLS-00103

    I have a procedure defined with these parameters

    create or replace PROCEDURE procAuth
    (
    EMAIL IN VARCHAR2,
    PASSWORD IN VARCHAR2,
    IP IN VARCHAR2,
    UL NUMBER
    )

    Using this code

    var x number
    procAuth exec ('[email protected]', ' 555555 ', ' 1.1.1.1': x);
    print x

    gives me


    Error at startup on line 2 of the command:
    procAuth exec ('[email protected]', ' 555555 ', ' 1.1.1.1': x);
    Error report:
    ORA-06550: line 1, column 65:
    PLS-00103: encountered the symbol "" when expecting one of the following values:

    . ( ) , * @ % & | = + - <>/ at is mod not rank rem = >
    .. < an exponent (*) > <>or! = or ~ = > = < = <>and or as
    between |
    The symbol ',' was replaced by ' ' to continue.
    06550 00000 - "line %s, column % s:\n%s".
    * Cause: Usually a PL/SQL compilation error.
    * Action:
    x
    ------



    Thanks for any help

    jerry8989 wrote:
    I have a procedure defined with these parameters

    create or replace PROCEDURE procAuth
    (
    EMAIL IN VARCHAR2,
    PASSWORD IN VARCHAR2,
    IP IN VARCHAR2,
    UL NUMBER
    )

    Using this code

    var x number
    exec procAuth (' [email protected]', '555555',' 1.1.1.1': x);
    print x

    gives me

    Error at startup on line 2 of the command:
    exec procAuth (' [email protected]', '555555',' 1.1.1.1': x);

    a comma is perhaps missing to the right of the right like apostrophe below?

    procAuth exec ('[email protected]', ' 555555 ', ' 1.1.1.1',: x);

  • Error PLS-00103 in simple code

    Hello

    I have the code simpleset play and get compile time error
    PLS-00103: Encountered the symbol "CREATE" 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 
    Here's the code...
    create or replace
    PROCEDURE PRC_TBL_RPT16_LOAD_INIT
      ( po_return_code  OUT VARCHAR2)
      IS
    
      v_exec_string       VARCHAR2(4000);
      v_text_line         whr_execution_log.text_line%TYPE;
      c_process_name      CONSTANT whr_execution_log.process_name%TYPE := 'PRC_TBL_RPT16_LOAD_INIT';
    
    BEGIN 
    
      v_text_line := 'Start';
      prc_whr_execution_log_entry(c_process_name,1,'INFO',v_text_line,NULL);
      COMMIT;
       DROP TABLE tbl_rpt16;
         
      CREATE TABLE tbl_rpt16 NOLOGGING AS
      SELECT A.postdateid,
             CAST(M.accountnumber AS VARCHAR2(25)) accountnumber,
             CAST(M.fname||' '||M.lname AS VARCHAR2(200)) mbr_name,
             COUNT(*) nbr_stays,
             SYSDATE date_created,
             CAST(c_process_name AS VARCHAR2(30)) created_by
      FROM   accrual A,
             memberattribute ma,
             MEMBER M
      WHERE  A.uiflag IS NOT NULL
      AND    A.postdateid IS NOT NULL
      AND    M.memberid = ma.memberid
      AND    M.memberid = A.memberid
      GROUP BY A.postdateid,
               M.accountnumber,
               M.lname,
               M.fname;
    EXCEPTION
      WHEN OTHERS THEN
        v_text_line := 'OTHER error: '||SQLERRM;
        prc_whr_execution_log_entry(c_process_name,1,'ERROR',v_text_line,NULL);
        COMMIT;
        po_return_code := '99';
    END;  -- PROCEDURE prc_tbl_rpt15_load_init
    Thank you
    Sandy

    You try to delete it and create a table (ie. do some DDL) in your procedure. This is not allowed. You will need to create your table in a script or use of execute immediate to do dynamic sql (which will allow you to do the DOF).

    However, why would you let drop and then re-create the same table?

    If the goal is to clear the data in the table, why not simply truncate the table (again, using the dynamic sql) and use an insert to repopulate it?

    Better yet, what this table is used to? If this is to temporarily store data so it can be accessed via a sql statement, why not just go straight to the tables and skip this step entirely?

  • 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

  • Error PLS-00103 stored procedure: encountered the symbol «/»

    Hello
    I'm trying this on Oracle 11 g on Centos 6.2 Express
    Summer make mistake

    ERROR on line 1:
    ORA-06550: line 1, column 7:
    PLS-00103: encountered the symbol "/" when expecting one of the following values:
    ..
    ERROR on line 1:
    ORA-06550: line 1, column 7:
    PLS-00103: encountered the symbol "/" when expecting one of the following values:

    For the following procedure, can someone help me?

    CREATE OR REPLACE PROCEDURE bulkInsert()
    AS
    BEGIN
    FOR x IN 1.100
    LOOP
    INSERT INTO arrested
    (order_id, order_name, order_status)
    VALUES
    (x, 'Fish', 'Y');
    END LOOP;
    COMMIT;
    END bulkInsert;
    /

    concerning
    Sameer

    44849b9b-03d8-4edd-bb18-e7f3e4fa4c6d wrote:

    Creates a file named bulkoracleinput and I'm running to help run /filename.

    If you want to run a SQL Script file in SQL more then you need to use the command @ and not the command EXECUTE.

    Try like this

    @/filename.

  • Help error PLS-00103

    Hi, I created a trigger below... but im getting errors... Please can find you it?






    create or replace trigger secure_emp
    before inserting on emp1
    Start
    If (to_char (sysdate, 'dy') and ('Sam', 'Sunday')) or (to_char (sysdate, 'HH24')
    not from 08:00 ' 18:00 '
    then raise_application_error (-20500, 'you can insert table only during opening hours in emp1.');
    end if;
    end;
    /


    SQL > show errors
    Errors for SECURE_EMP TRIGGER:

    LINE/COL ERROR
    -------- -----------------------------------------------------------------
    4/2 PLS-00103: encountered the symbol "THEN" when expecting one of
    What follows:
    ), * & -+ / at rem rest mod < an exhibitor > (*) and or
    as | multiset
    The symbol ")" was replaced by "THEN" continue.

    Hello

    You have too many ' (')

    create or replace trigger secure_emp
       before insert
       on emp1
    begin
       if (to_char(sysdate, 'dy') in ('sat', 'sun'))
       or to_char(sysdate, 'hh24:mi') not between '08:00' and '18:00'
       then
          raise_application_error(-20500
                                 ,'You may insert into emp1 table only during business hours.');
       end if;
    end;
    /
    

    Concerning
    Peter

  • Error PLS-00103.  I am doing something stupid

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

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

    The difficulty in this conversion of SQL... Thank you in advance.


    FUNCTION IEXCGQBacklog_QID)
    v_BDateTime DATE
    v_EDateTime DATE
    v_QueueID INT)
    RETURN int IS
    v_retval INT
    v_BLogOffset DATE;
    BEGIN
    / * - Identify earlier backlog * /.
    SET v_BLogOffset: = v_BDateTime - 1;

    SELECT COUNT (DISTINCT qiv.interactionid) IN v_retval
    of queueinteractionsview as qiv
    Join participantsegment on ps.participantsegmentid = qiv.firstagentsegid ps
    where (ibegintime BETWEEN v_BLogOffset AND v_BDateTime)
    and ((ps.pbegintime > v_EDateTime) OR (qiv.psroutereasonid in (2,3,4,5)))
    and queueid = v_QueueID;

    RETURN v_retval;
    END;

    write '; '.

    INT v_retval;
    v_BLogOffset DATE;

Maybe you are looking for

  • Necessary drivers after installing Windows on Tecra M2

    HelloCould you tell me is there any order on the installation of drivers for Tecra M2? I heard that it is very important to install them in the precise order, but I can't. If there is, please help me and write the list of drivers in the order. I seco

  • Copy files with dasylab

    Hallo! I need a little help! I want to copy files by pressing a button in dasylab, is this possible? Another question: It is possible to discover if an external storage device is connected with dasylab? This is the reason why I'm asking you: I record

  • Pavilion dv6-2130er: unknown port

    Hello! Recently, I disassembled my computer laptop dv6-2130er and found a unusual port. After some Googling it seemes mSATA or miniPCI-E... On the other hand, it may be for tv-tuner, as he replied to man with some laptop dv7. But I have not found inf

  • How to remove virus win32/Pdfjsc.YZ

    basics of Microsoft said the virus, but I can't remove it.

  • This patch package could not be opened

    I'm running Windows XP Professional and Explorer 8 Some time ago, I installed Silverlight and it was working fine then one day an error popped up saying that she needed to be reinstalled. Also, I got the blue screen of death at the same time. I went