PLSQL Problem: PLS-00103

I have sucessfully compiled the following....
CREATE OR REPLACE PROCEDURE instrument_ids_proc
IS
BEGIN
INSERT INTO schema1.record_cat
SELECT z.id
, z.opened
, z.closed
, y.shop_name
FROM (
SELECT id, opened, closed
FROM schema2.shop_details_all
WHERE digitised IS NOT NULL
AND NVL(closed,2009)- opened >=150
MINUS
SELECT DISTINCT id, opened, closed
FROM (
SELECT a.id
, b.rec_date
, LEAD(b.rec_date) OVER(ORDER BY a.id,b.rec_date) le_dat
, LEAD(a.id) OVER(ORDER BY a.id,b.rec_date) le_id
, a.opened
, a.closed
FROM schema2.shop_details_all a
, schema1.shop_sales b
WHERE NVL(closed,2009)- opened >=150
AND a.digitised IS NOT null
AND a.id=b.id
WHERE le_dat-rec_Date >365 AND le_id=id
) z
JOIN schema2.shop_details_all y
ON z.id = y.id;
END instrument_ids_proc;
Now I can compile the code fine and if I take it out of the PL SQL block and just run it as stand alone SQL it works fine.
But when I try to run the PLSQL by doing - execute gauge_ids_proc, I get the following error...
08:44:25 Error executing statement: ORA-06550: line 3, column 1:
08:44:25 PLS-00103: Encountered the symbol "END" when expecting one of the following:
08:44:25 := . ( @ % ;
08:44:25 The symbol ";" was substituted for "END" to continue
No idea why this is happening, any help?
Cheers

Hi,
Could you please post what you are doing, exactly like below.
I.e. formatted code, enclosed in {noformat}{noformat} tags, along with line numbers from SQL*Plus and the exact error message, including line number.SQL>create or replace procedure instrument_ids_proc
2 is
3 begin
4 insert into schema1.record_cat
5 select z.id
6 ,z.opened
7 ,z.closed
8 ,y.shop_name
9 from (select id, opened, closed
10 from schema2.shop_details_all
11 where digitised is not null
12 and nvl(closed, 2009) - opened >= 150
13 minus
14 select distinct id, opened, closed
15 from (select a.id
16 ,b.rec_date
17 ,lead(b.rec_date) over (order by a.id, b.rec_date)
18 le_dat
19 ,lead(a.id) over (order by a.id, b.rec_date) le_id
20 ,a.opened
21 ,a.closed
22 from schema2.shop_details_all a, schema1.shop_sales b
23 where nvl(closed, 2009) - opened >= 150
24 and a.digitised is not null
25 and a.id = b.id)
26 where le_dat - rec_date > 365
27 and le_id = id) z join schema2.shop_details_all y
28 on z.id = y.id;
29 end instrument_ids_proc;
30 /
Warning: Procedure created with compilation errors.
SQL>
SQL>exec instrument_ids_proc
BEGIN instrument_ids_proc; END;
ERROR at line 1:
ORA-06550: line 1, column 7:
PLS-00905: object SCOTT.INSTRUMENT_IDS_PROC is invalid
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
SQL>
Edit:
Looks like Max might have a point. Please look at my error message, it says line 1, column 7.
Yours say line 3 column 1.
Regards
Peter
Edited by: Peter on Dec 9, 2009 2:23 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Similar Messages

  • 11g R1 problem... PLS-00103: Encountered the symbol "¿" when expecting...

    Yesterday AM. my customer went live with an upgrade. Things started out ok, but as the load on the system started to build, we started seeing errors.
    The reported error is:
    S1000 Oracle ODBC Ora ORA-06550: line 1, column 42:
    PLS-00103: Encountered the symbol "¿" when expecting one of the following:
    . ( ) , * @ % & = - + < / > at in is mod remainder not rem =>
    <an exponent (**)> <> or != or ~= >= <= <> and or like
    This is in response to calling a stored procedure with this signature.
    MY_THING (
    p1 IN NUMBER,
    p2 OUT NUMBER,
    p2 IN NUMBER
    I believe this is a failure with the ODBC driver to parse
    {call MY_STUFF.MY_THING(791200, ?, 1067744)}
    Now to head off the obvious responses, I'm going to say these things in boldface
    the procedure itself is fine, and works flawlessly under test
    *nowhere in any of the code is an upside-down '?' as reported in the error message*
    Has anyone else encountered this--or better yet solved it?

    thanks for the replies.
    I'd have to rule out triggers at the point the stored procedure is run. Other than logging, it doesn't do any writes to the database. It does a couple of look-ups, and returns the results in a cursor. As for the web servers, they're pretty much copies of each other. 'Out of the box + updates' Windows Server 2008 machines with our application installed on each.
    The software issuing the ODBC call is old, well worn, tried and true C++. In this case the only string parameters passed are 'PA' or 'PJ' the rest is all integers.
    But again I want to stress that it doesn't appear that we reach the database when it fails. It appears to fail when the ODBC driver is parsing the '{call xxxxxx} statement.
    On a hunch, I've just reconfigured our application to treat the offensive call as if it were an 'external' reference. Meaning that a new ODBC connection will be created/destroyed for each run. Not very efficient, but I'll take slow over broken any day. It's too early to tell if this will eliminate the error.

  • PLS-00103: Encountered the symbol "" when expecting one of the following:

    Hi I am creating trigger using CFQUERY tag of cold fusion on oracle..
    <CFQUERY DATASOURCE="CRM">
    create or replace trigger AWC_ACCESSROLESID_TRI
    before insert on AWC_ACCESSROLES
    for each row
    begin
    select AWC_ACCESSROLESID_SEQ.nextval into :new.AR_ID from dual;
    end;
    </CFQUERY>
    But the created trigger is not compiled, it is giving the following error
    "Line # = 1 Column # = 6 Error Text = PLS-00103: Encountered the symbol "" when expecting one of the following: begin case declare exit for goto if loop mod null pragma raise return select update while with <an identifier> <a double-quoted delimited-identifier> <a bind variable> << close current delete fetch lock insert open rollback savepoint set sql execute commit forall merge <a single-quoted SQL string> pipe The symbol "" was ignored."
    If I edit that trigger in enterprose manager console by pressing space and compile that, it is working fine with out any error. If i run the above statement in sql *plus, It is working fine with out any error.
    Can you please tell me why this is happening if i run it using cfquery tag and also the possible solutions.
    Thanks in advance,
    Vinod

    So it works in Enterprise manager. It works in SQL*Plus. It doesn't work in CFQUERY. Sounds to me like a ColdFusion problem rather than an Oracle problem to be honest. Aren't there any ColdFusion support resources?
    Cheers, APC

  • ORA-06550: line 5, column 57: PLS-00103: Encountered the symbol "F01_" when

    Hello,
    I wanted to use the APEX_ITEM.DISPLAY_AND_SAVE
    Here is my query:
    DECLARE
    QUERY VARCHAR2 (2000);
    BEGIN
    QUERY := 'SELECT '
    ||'APEX_ITEM.DISPLAY_AND_SAVE(1,REGISTRATION_ID,'f01_'||ROWNUM, NULL) REGISTRATION_ID, '
    ||'APEX_ITEM.DISPLAY_AND_SAVE(2,STATUS,'f02_'||ROWNUM, NULL) STATUS, '
    ||'APEX_ITEM.DISPLAY_AND_SAVE(3,CALL_CODE,'f03_'||ROWNUM, NULL) CALL_CODE, '
    ||'APEX_ITEM.DISPLAY_AND_SAVE(4,PARTNER_USER_ID,'f04_'||ROWNUM, NULL) PARTNER_USER_ID,'
    ||'APEX_ITEM.DISPLAY_AND_SAVE(5,COORDINATOR_USER_ID,'f05_'||ROWNUM, NULL) COORDINATOR_USER_ID, '
    ||'APEX_ITEM.DISPLAY_AND_SAVE(6,COORDINATOR_EMAIL,'f06_'||ROWNUM, NULL) COORDINATOR_EMAIL, '
    ||'APEX_ITEM.DISPLAY_AND_SAVE(7,COORDINATOR_FINAUTH_EMAIL,'f07_'||ROWNUM, NULL) COORDINATOR_FINAUTH_EMAIL,'
    ||'APEX_ITEM.DISPLAY_AND_SAVE(8,COORDINATOR_FULL_ADDRESS,'f08_'||ROWNUM, NULL) COORDINATOR_FULL_ADDRESS, '
    ||'APEX_ITEM.DISPLAY_AND_SAVE(9,COORDINATOR_NAME,'f09_'||ROWNUM, NULL) COORDINATOR_NAME, '
    ||'APEX_ITEM.DISPLAY_AND_SAVE(10,COORDINATOR_FAX,'f10_'||ROWNUM, NULL) COORDINATOR_FAX,'
    ||'APEX_ITEM.DISPLAY_AND_SAVE(11,COORDINATOR_TEL,'f11_'||ROWNUM, NULL) COORDINATOR_TEL, '
    ||'APEX_ITEM.DISPLAY_AND_SAVE(12,COORDINATOR_COUNTRY,'f12_'||ROWNUM, NULL) COORDINATOR_COUNTRY, '
    ||'APEX_ITEM.DISPLAY_AND_SAVE(13,COORDINATOR_COMPANY_NAME,'f13_'||ROWNUM, NULL) COORDINATOR_COMPANY_NAME,'
    ||'APEX_ITEM.DISPLAY_AND_SAVE(14,DATE_LETTER_SENT,'f14_'||ROWNUM, NULL) DATE_LETTER_SENT, '
    ||'APEX_ITEM.DISPLAY_AND_SAVE(15,DATE_LAST_SUBMISSION,'f15_'||ROWNUM, NULL) DATE_LAST_SUBMISSION, '
    ||'APEX_ITEM.DISPLAY_AND_SAVE(16,PROPOSAL_ACRONYM,'f16_'||ROWNUM, NULL) PROPOSAL_ACRONYM,'
    ||'APEX_ITEM.DISPLAY_AND_SAVE(17,INSTRUMENT_CODE,'f17_'||ROWNUM, NULL) INSTRUMENT_CODE, '
    ||'APEX_ITEM.DISPLAY_AND_SAVE(18,TITLE,'f18_'||ROWNUM, NULL) TITLE, '
    ||'APEX_ITEM.DISPLAY_AND_SAVE(19,SUBMITTED,'f19_'||ROWNUM, NULL) SUBMITTED, '
    ||'APEX_ITEM.DISPLAY_AND_SAVE(20,PREPARATION,'f20_'||ROWNUM, NULL) PREPARATION, '
    ||'APEX_ITEM.DISPLAY_AND_SAVE(21,PASS_BY_MAIL,'f21_'||ROWNUM, NULL) PASS_BY_MAIL,'
    ||'APEX_ITEM.DISPLAY_AND_SAVE(22,PROPOSAL_ID,'f22_'||ROWNUM, NULL) PROPOSAL_ID, '
    ||'APEX_ITEM.DISPLAY_AND_SAVE(23,PROPOSAL_NUMBER,'f23_'||ROWNUM, NULL) PROPOSAL_NUMBER '
    ||' FROM SUZANREGISTRATIONVIEW '
    ||' where 1 = 1 ';
    IF LENGTH (V ('P4_REGISTRATION_ID')) > 0
    THEN
    QUERY :=
    QUERY || ' and REGISTRATION_ID like ' || V ('P4_REGISTRATION_ID');
    ELSE
    QUERY := QUERY || '';
    END IF;
    IF LENGTH (V ('P4_CALL_CODE')) > 0
    THEN
    QUERY := QUERY || ' and CALL_CODE like ''' || V ('P4_CALL_CODE') || '''';
    ELSE
    QUERY := QUERY || '';
    END IF;
    IF LENGTH (V ('P4_COORDINATOR_USER_ID')) > 0
    THEN
    QUERY :=
    QUERY
    || ' and (upper(COORDINATOR_USER_ID)) like (upper('''
    || V ('P4_COORDINATOR_USER_ID')
    || '''))';
    ELSE
    QUERY := QUERY || '';
    END IF;
    IF LENGTH (V ('P4_COORDINATOR_FINAUTH_EMAIL')) > 0
    THEN
    QUERY :=
    QUERY
    || ' and (upper(R.COORDINATOR_EMAIL)) like (upper('''
    || V ('P4_COORDINATOR_FINAUTH_EMAIL')
    || '''))';
    ELSE
    QUERY := QUERY || '';
    END IF;
    IF LENGTH (V ('P4_COORDINATOR_NAME')) > 0
    THEN
    QUERY :=
    QUERY
    || ' and upper(COORDINATOR_NAME) like (upper('''
    || V ('P4_COORDINATOR_NAME')
    || '''))';
    ELSE
    QUERY := QUERY || '';
    END IF;
    IF LENGTH (V ('P4_COORDINATOR_COMPANY_NAME')) > 0
    THEN
    QUERY :=
    QUERY
    || ' and (upper(COORDINATOR_COMPANY_NAME)) like (upper('''
    || V ('P4_COORDINATOR_COMPANY_NAME')
    || '''))';
    ELSE
    QUERY := QUERY || '';
    END IF;
    IF LENGTH (V ('P4_PARTNER_USER_ID')) > 0
    THEN
    QUERY :=
    QUERY
    || ' and (upper(PARTNER_USER_ID)) like (upper('''
    || V ('P4_PARTNER_USER_ID')
    || '''))';
    ELSE
    QUERY := QUERY || '';
    END IF;
    IF LENGTH (V ('P4_PROPOSAL_ACRONYM')) > 0
    THEN
    QUERY :=
    QUERY
    || ' and (upper(proposal_acronym)) like (upper('''
    || V ('P4_PROPOSAL_ACRONYM')
    || '''))';
    ELSE
    QUERY := QUERY || '';
    END IF;
    RETURN QUERY;
    END;
    And here is the error encountered:
    1 error has occurred
    * Function returning SQL query: Query cannot be parsed within the Builder. If you believe your query is syntactically correct, check the generic columns checkbox below the region source to proceed without parsing.
    (ORA-06550: line 5, column 57: PLS-00103: Encountered the symbol "F01_" when expecting one of the following: * & = - + ; < / > at in is mod remainder not rem <> or != or ~= >= <= <> and or like LIKE2_ LIKE4_ LIKEC_ between || member SUBMULTISET_)
    I don't understand why the engine returns an error at that point.
    Despite the fact that I follow the user guide and the Denes Kubicek's sample examples, I still have that error.
    If I remove the part 'f01_' || and only keep the rownum, the problem is solved.
    Do you have any idea ?
    Thanks in advance for your answers.
    Regards,
    Stessy Delcroix

    HI MickyWay,
    So simple. :-)
    Problem solved.
    Thanks a lot (merci beaucoup)

  • Hard coded SQL string doesn't run with error PLS-00103

    I have created a package with 34 stored procedures [pre]to create some materialized view with hard coded SQL [pre]string (client required for this hard coding). The [pre]first part with 21 simple create statements has
    [pre]worked fine. 2nd part with 11 complicated create [pre]statements, only first one has worked. all others [pre]have  not worked.
    [pre]
    I used dbms_output.put_line (sql_string) to check the [pre]individual create statement, it has looked fine. I [pre]have run individual SP within package. I have got [pre]error message as ORA-06550: line 1, column 45:
    [pre]PLS-00103: Encountered the symbol "end-of-file" when [pre]expecting one of the following: ; [pre]
    <an identifier> <a double-quoted delimited-identifier> [pre]The symbol ";" was substituted for "end-of-file" to [pre]continue.
    [pre]I have checked SQL string between 1st part and 2nd [pre]part. They are the same and all with ';' to end SQL [pre]string and END SP name in the end. Please help me to [pre]identify where the problems are. Thanks. Followings [pre]are some sample SQL string:
    [pre]PROCEDURE sp_1st_string
    [pre]IS
    [pre]BEGIN
    [pre]    EXECUTE IMMEDIATE 'CREATE MATERIALIZED VIEW
    [pre]mv_name1 TABLESPACE space_name PARALLEL ( DEGREE [pre]DEFAULT INSTANCES DEFAULT ) BUILD IMMEDIATE REFRESH [pre]COMPLETE ON DEMAND WITH PRIMARY KEY AS SELECT col1, [pre]col2,col3, col4, col5 FROM tableone A, table_two B [pre]WHERE A.id = B.id';
    [pre]COMMIT;
    [pre]END sp_1st_string;
    [pre]PROCEDURE sp_2nd_string
    [pre]IS
    [pre]BEGIN
    [pre]   EXECUTE IMMEDIATE ' CREATE MATERIALIZED VIEW
    [pre]mv_name2 TABLESPACE PDE_DATA PARALLEL ( DEGREE [pre]DEFAULT INSTANCES DEFAULT ) BUILD IMMEDIATE REFRESH [pre]COMPLETE ON DEMAND WITH PRIMARY KEY AS select col1 .. [pre]col10 from tableone a, tabletwo b, tablethree c, [pre]tablefour d, tablefive e, tablesix f where clause;
    [pre]COMMIT;
    [pre]END sp_2nd_string;
    Message was edited by:
            citicbj
    Message was edited by:
            citicbj                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    stevencallan:
    Thanks for your advice. I have been thinking the above problem may be [pre]caused by this. If I run 'Create MV statement' in SQL PLUS or Toad, single quote [pre]will work. But when I put hard coded SQL string in package and stored [pre]procedure, it will cause compiling error. After I took off single quote, SP will be [pre][pre]compiled successfully. When I run package.sp, it will cause the problem. [pre]Here is the sample code:[pre]
    [pre]CREATE MATERIALIZED VIEW my_mv TABLESPACE space_name [pre][pre]PARALLEL (DEGREE DEFAULT INSTANCES DEFAULT) BUILD IMMEDIATE [pre]REFRESH COMPLETE ON DEMAND WITH PRIMARY KEY AS select A.ID , [pre]A.CNTL_NUM, C.XX_CODE, D.FIRST_NAME, D.MDL_NAME, [pre]D.LAST_NAME, H.XX_DESC, TO_DATE(TO_CHAR(C.CREAT_TS, [pre]'MM/DD/YYYY'),'MM/DD/YY'), F.STATE, CASE WHEN A.XX_CODE IS NOT NULL [pre]THEN X END, E.X_DESC  from TABLE1 A, TABLE2 B, TABLE3 C, TABLE4 [pre]D, TABLE5 E, TABLE6 F, TABLE7 G, TABLE8 H
    [pre]where D.X_SW = 'X' and B.X_SW = X' and G.X_SW = 'X' and B.CNTL_ID = [pre]A.CNTL_ID and B.CNTL_ID = D.CNTL_ID and B.X_ID = C.X_ID and B.X_ID = [pre]G.X_ID and B.X_ID = F.X_ID and G.X_CD = H.X_CD and B.X_CD = E.X_CD [pre]and E.X_CD = '25' and C.ENRLMT_ID NOT LIKE 'O%'; [pre]
    [pre]When I hard coded this statement in package and sp, I have to take off single [pre]quote ' ' form 'MM/DD/YYYY', 'MM/DD/YY', X_SW ='X', X_CD = '25' AND NOT [pre]LIKE 'O%', Then I can compile whole package successfully. This is why I [pre]mentioned that 1st part 21 simple create statement work because they don't have [pre]these single quote in the statement. In 2nd part with 13 complicated create [pre]statements, some of them have no single quote in the statement. They will [pre]run. Some of them with single quote in statement. They will have the problem [pre]to run if I take off single for compiling. [pre]
    [pre]Please give me some idea what is the reason. Thanks a lot.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • PLS-00103 in Trigger compilation !

    We had our Database in Oracle 8i 8.1.5 & we took an Export from
    that database, our client has Purchased Oracle 8.1.7 standard
    edition, we imported the exp.dmp in to the new database.
    The specific problem is some of the Database Triggers are not
    working the problem is with a specific select statement which
    worked fine in 8.1.5,
    The Error number is PLS-00103 or a Parser error wrt to string.
    Error text says-- encountered ) when expecting one of the
    following
    from
    Whats this problem? why a statement which worked in 8.1.5 did
    not work in 8.1.7? Whats the Remedy?
    Thanks in advance for giving solutions
    Mahesh

    Hi mahesh,
    Please recomplire ur trigger code. This is a general problem
    while porting from any lower release of Oracle to 8.1.7 You will
    encounter this even if U have build in procedural objects and U
    are trying to port it . Collect the text from user_source table
    giving the trigger name and recompile it.
    anurag

  • PLS-00103: Encountered the symbol ""

    Hi
    I'm trying to create a PL/SQL function using JDBC and the procedure gets created but with status invalid. After checking the user_errors view I get:
    PLS-00103: Encountered the symbol "" when expecting one of the following: begin function package pragma procedure subtype type use form current cursor external language
    I'm using the following statement:
    statement = connection.prepareStatement ("CREATE OR REPLACE FUNCTION SCOTT.WHATEVER return varchar2 as begin return ('Whatever 2'); end;");
    statement.execute ();
    If I run the same statement from SQL*Plus I get no problems.
    Yes!, the application requires that I create store procedures using JDBC, no other way.
    Any ideas?
    Regards,
    Néstor Boscán

    Nestor,
    Works for me on Oracle 9.2.0.7 database (running on SUN [sparc] Solaris 9) with JDK 1.4.2_07 and "ojdbc14.jar" JDBC [thin] driver.
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.PreparedStatement;
    import java.sql.SQLException;
    public class CrSqlFun {
      public static void main(String[] args) {
        Connection c = null;
        PreparedStatement ps = null;
        String url = "jdbc:oracle:thin:scott/tiger@host:1521:orcl";
        String sql = "create or replace function WHATEVER return varchar2 as " +
                                                 "begin return 'Whatever 2'; end;";
        try {
          Class.forName("oracle.jdbc.driver.OracleDriver");
          c = DriverManager.getConnection(url);
          ps = c.prepareStatement(sql);
          ps.executeUpdate();
        catch (Exception x) {
          x.printStackTrace(System.err);
        finally {
          if (ps != null) {
            try {
              ps.close();
            catch (SQLException sx) {
              System.out.println("Failed to close statement.");
          if (c != null) {
            try {
              c.close();
            catch (SQLException sx) {
              System.out.println("Failed to close connection.");
    }Good Luck,
    Avi.

  • PL/SQL Error  PLS-00103

    Hi All,
    I am currently working a "package header" and "package body".
    I have created a user defined data type ( record type ) in pl/sql pacakge header.
    And I am trying to use it from pl/sql body, especially
    I am using this type as parameter type for a procedure.
    Because of this I am getting below error at the time
    of compilation.
    LINE/COL ERROR
    2/3 PLS-00103: Encountered the symbol "CREATE" when expecting one of
    the following:
    begin end function package pragma procedure subtype type use
    <an identifier> <a double-quoted delimited-identifier> form
    current cursor
    The symbol "CREATE" was ignored.
    Can any one guide me on this...
    Thanks in advance.
    Regards,
    Srini
    , from body
    I was trying

    I was able to get rid of the problem by creating header
    and body of the package with two different names.
    Example: ph and pb
    But for my curiosity , just like to know,
    Both "Package Header" and "Package Body" must be defined
    with two different names ?
    Is there any other way to get rid of this exception ?
    Thanks in advance.
    Cheers,
    Srini

  • ORA-06550: Ligne 1, colonne 34 : PLS-00103 In Validation Item with APEX 4

    Hello,
    I am using APEX 4?
    i have created ths program to validate an item
    DECLARE
    LONGEUR1 NUMBER;
    BEGIN
    Select LONGEUR INTO LONGEUR1 FROM OUVRAGE WHERE code_ouvrage = (select code_ouvrage from ouvrage where libelle = :P6_CODE_OUVRAGE);
    IF :P6_PK < 0 or :P6_PK > LONGEUR1 THEN
    RETURN FALSE;
    ELSE
    RETURN TRUE;
    END IF;
    END;
    i have had thir error message when running page :
    ORA-06550: Ligne 1, colonne 34 : PLS-00103: Symbole "DECLARE" rencontré à la place d'un des symboles suivants : ( ) - + case mod new not null others table avg count current exists max min prior sql stddev sum variance execute multiset the both leading trailing forall merge year month DAY_ hour minute second timezone_hour timezone_minute timezone_region timezone_abbr time timestamp interval date
    ERR-1025 Error processing PLSQL expression. DECLARE LONGEUR1 NUMBER; BEGIN Select LONGEUR INTO LONGEUR1 FROM OUVRAGE WHERE code_ouvrage = (select code_ouvrage from ouvrage where libelle = :P6_CODE_OUVRAGE); IF :P6_PK < 0 or :P6_PK > LONGEUR1 THEN RETURN FALSE; ELSE RETURN TRUE; END IF; END;
    Any siggestion please ?

    ouadah wrote:
    Hello,
    I am using APEX 4?
    i have created ths program to validate an item
    DECLARE
    LONGEUR1 NUMBER;
    BEGIN
    Select LONGEUR INTO LONGEUR1 FROM OUVRAGE WHERE code_ouvrage = (select code_ouvrage from ouvrage where libelle = :P6_CODE_OUVRAGE);
    IF :P6_PK < 0 or :P6_PK > LONGEUR1 THEN
    RETURN FALSE;
    ELSE
    RETURN TRUE;
    END IF;
    END;
    i have had thir error message when running page :
    ORA-06550: Ligne 1, colonne 34 : PLS-00103: Symbole "DECLARE" rencontré à la place d'un des symboles suivants : ( ) - + case mod new not null others table avg count current exists max min prior sql stddev sum variance execute multiset the both leading trailing forall merge year month DAY_ hour minute second timezone_hour timezone_minute timezone_region timezone_abbr time timestamp interval date
    ERR-1025 Error processing PLSQL expression. DECLARE LONGEUR1 NUMBER; BEGIN Select LONGEUR INTO LONGEUR1 FROM OUVRAGE WHERE code_ouvrage = (select code_ouvrage from ouvrage where libelle = :P6_CODE_OUVRAGE); IF :P6_PK < 0 or :P6_PK > LONGEUR1 THEN RETURN FALSE; ELSE RETURN TRUE; END IF; END;
    Any siggestion please ?What is the Validation Type? It looks like you are attempting to use code for a Function Returning Boolean validation in one of type PL/SQL Expression.
    Ensure the Validation Type is Function Returning Boolean.

  • PL/SQL Explicit Cursors,Error(3,15): PLS-00103

    I creat procedure as following:
    PROCEDURE Proj_Using_Most_People_ByGender (TheGender Employee.Sex%Type)
    IS
    ProjIdWorks_On.Pno%TYPE;
    ProjCnt number;
    CURSOR Get_People_Involved(Gender IN Employee.Sex%Type)
    IS
    select w.Pno, count(*) as TotalPeople
    from Works_On w, Employee e
    where e.Sex = Gender
    and e.Ssn = w.Essn
    group by w.Pno
    order by TotalPeople desc;
    BEGIN
    open Get_People_Involved(TheGender);
    for i in 1..3 loop
    fetch Get_People_Involved into ProjId, ProjCnt;
    exit when Get_People_Involved%NOTFOUND;
    dbms_output.put_line (' Project: ' || to_char(ProjId) ||
    ' Personnel: ' || to_char(ProjCnt) );
    end loop;
    close Get_People_Involved;
    EXCEPTION
    when others then
    dbms_output.PUT_LINE ( 'Problems' );
    END;
    error is:
    Error(3,15): PLS-00103: Encountered the symbol "." when expecting one of the following: constant exception <an identifier> <a double-quoted delimited-identifier> table LONG_ double ref char time timestamp interval date binary national character nchar The symbol "<an identifier>" was substituted for "." to continue.
    Anybody can help me? Thanks a lot!

    I didn't see a problem - except you should have
    CREATE OR REPLACE PROCEDURE ... and not just PROCEDURE ...
    SQL> create or replace PROCEDURE explitpro (TheGender Employee.Sex%Type) IS
      2  ProjId  Works_On.Pno%TYPE;
      3  ProjCnt number;
      4  CURSOR Get_People_Involved(Gender IN Employee.Sex%Type) IS
      5     select w.Pno, count(*) as TotalPeople
      6        from Works_On w, Employee e
      7        where e.Sex = Gender
      8          and e.Ssn = w.Essn
      9      group by w.Pno
    10      order by TotalPeople desc;
    11  BEGIN
    12    open Get_People_Involved(TheGender);
    13    for i in 1..3 loop
    14       fetch Get_People_Involved into ProjId, ProjCnt;
    15            exit when Get_People_Involved%NOTFOUND;
    16       dbms_output.put_line (' Project: ' || to_char(ProjId) ||
    17                             ' Personnel: ' || to_char(ProjCnt) );
    18     end loop;
    19     close Get_People_Involved;
    20  EXCEPTION
    21    when others then
    22       dbms_output.PUT_LINE ( 'Problems' );
    23  END;
    24 /
    Procedure created.
    SQL> EXECUTE EXPLITPRO('F')
    PL/SQL procedure successfully completed.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Error while creating a procedure (PLS-00103)

    Hi Am create the follwing Procedure:-
    create or replace PROCEDURE XL_SP_ROGUEUSERS (
    csrresultset_inout IN OUT sys_refcursor,
    intuserkey_in IN NUMBER,
    strsortcolumn_in IN VARCHAR2,
    strsortorder_in IN VARCHAR2,
    intstartrow_in IN NUMBER,
    intpagesize_in IN NUMBER,
    intdocount_in IN NUMBER,
    inttotalrows_out OUT NUMBER,
    strfiltercolumnlist_in IN VARCHAR2,
    strfiltercolumnvaluelist_in IN VARCHAR2,
    strudfcolumnlist_in IN VARCHAR2,
    strudfcolumnvaluelist_in IN VARCHAR2,
    struserlogin_in IN VARCHAR2,
    strfirstname_in IN VARCHAR2,
    strlastname_in IN VARCHAR2,
    strdate_in IN VARCHAR2
    AS
    BEGIN
    DECLARE
    whereclause VARCHAR2(8000);
    select_stmt VARCHAR2(8000);
    strColumnList VARCHAR2(4000);
    strDateFormat VARCHAR2 (80);
    strFromClause VARCHAR2(4000);
    strWhereClause VARCHAR2(4000);
    strOrderByClause VARCHAR2(2000);
    intSortDirection_in PLS_INTEGER;
    entsum     varchar2(20) := 'Entitlements Summary';
    str_row EXCEPTION;
    do_cnt EXCEPTION;
    no_logged_in_user EXCEPTION;     
    property_not_found EXCEPTION;
    pragma exception_init(Str_row,-20001);
    pragma exception_init(Do_cnt,-20002);
    pragma exception_init(no_logged_in_user,-20003);     
    BEGIN
    -- Throw exception if the start row or page size is either NULL or have
    -- values less than or equal to zero
    IF (intstartrow_in <= 0 OR intpagesize_in <= 0 OR intstartrow_in IS NULL OR intpagesize_in IS NULL)
         THEN
         RAISE str_row;
    END IF;
    -- Throw exception if the intdocount_in parameter is NULL or has a value
    -- other than 0 and 1
    IF intdocount_in NOT IN (0, 1, 2) OR intdocount_in IS NULL
         THEN
         RAISE do_cnt;
    END IF;
    -- Throw exception if the intuserkey_in (logged in user) parameter is NULL
    IF intuserkey_in IS NULL or intuserkey_in <= 0
         THEN
         RAISE no_logged_in_user;
    END IF;
    -- Now, we start accumulating the whereclause based on the input
    -- parameters, performing error checking along the way.
    --Organization Permissioning.
    /* whereclause := ' and usr.act_key IN (SELECT DISTINCT act2.act_key FROM '||
    ' act act2, aad, usg, ugp, usr usr5 '||
    ' WHERE act2.act_key = aad.act_key '||
    ' and aad.ugp_key = usg.ugp_key '||
    ' and ugp.ugp_key = usg.ugp_key'||
    ' and usg.usr_key = usr5.usr_key'||
    ' and usr5.usr_key = '||intuserkey_in||')'; */
    IF strfiltercolumnlist_in IS NOT NULL AND
    strfiltercolumnvaluelist_in IS NOT NULL THEN
    whereclause := whereclause
    || xl_sfg_parseparams(strfiltercolumnlist_in,
    strfiltercolumnvaluelist_in);
    END IF;
    IF struserlogin_in IS NOT NULL THEN
    whereclause := whereclause
    || ' AND UPPER(usr.usr_login) LIKE '
    || UPPER (''''||struserlogin_in||'''')
    || ' ';
    END IF;
    IF strudfcolumnlist_in IS NOT NULL AND
    strudfcolumnvaluelist_in IS NOT NULL THEN
    whereclause := whereclause
    || xl_sfg_parseparams(strudfcolumnlist_in,
    strudfcolumnvaluelist_in);
    END IF;
    -- Perform the count query and store the result in inttotalrows_out
         inttotalrows_out := 0;
    IF intdocount_in IN (1,2) THEN
    EXECUTE IMMEDIATE ' select count(*) from((SELECT upper(rcd.RCD_VALUE) as "User ID" '||                                        ' FROM rce, obj, rcd, orf '||
                   ' WHERE '||
                   ' RCE_STATUS like 'No Match Found' '||
                   ' AND ((orf.ORF_FIELDNAME like 'User ID') or (orf.ORF_FIELDNAME like 'User%Login')) '||
                   ' AND rce.OBJ_KEY = obj.OBJ_KEY '||
                   ' AND rce.RCE_KEY = rcd.RCE_KEY '||
                   ' AND rcd.ORF_KEY = orf.ORF_KEY '||
                   ' ) '||
                   ' MINUS '||
                   ' (SELECT usr.USR_LOGIN FROM usr '||
                   ' WHERE '||
                   ' usr.USR_STATUS like 'Active')) '||
                   whereclause INTO inttotalrows_out;
    -- UI needs the SP to return result set always. The following is returned
    -- when the indocount is 2 which does not return any result set but count
    IF intdocount_in = 2 THEN
    select_stmt := 'SELECT ''dummy'' FROM dual';
    OPEN csrresultset_inout FOR select_stmt;          
    END IF;
    END IF;
    -- If intdocount_in is 2, UI just wants to get the totalrows to give
    -- the warning to users if the result set exceeds the limit set by
    -- UI. When ntdocount_in is 2, the following block won't be executed.
    IF intdocount_in IN (0,1) THEN          
    -- Construct the select query by calling XL_SPG_GetPagingSql.
    -- This is the main query for this stored procedure
    strOrderByClause := ' usr.usr_login';
    --strOrderByClause := ' req.req_key';
    IF strsortorder_in = 'DESC' THEN
    intSortDirection_in := 0;
    ELSE
    intSortDirection_in := 1;          
    END IF;
    XL_SPG_GetPagingSql(strColumnList,
    strFromClause,
    whereclause,
    strOrderByClause,
    intSortDirection_in,
    intStartRow_in,
    intPageSize_in,
    select_stmt
    OPEN csrresultset_inout FOR select_stmt;
    END IF;     
    -- Exception Handling
    EXCEPTION
    WHEN Str_row THEN
    RAISE_APPLICATION_ERROR(sqlcode,
    'Start Row/Page Size cannot be NULL OR less than or equal to zero ');
    WHEN Do_cnt THEN
    RAISE_APPLICATION_ERROR(sqlcode,
    'Do Count must be 0, 1 or 2. ');
    WHEN no_logged_in_user THEN
    RAISE_APPLICATION_ERROR(sqlcode,
    'Logged-in User Key cannot be NULL OR less than or equal to zero ');
    END;
    end XL_SP_ROGUEUSERS;
    But Am getting the following error message, I couldn't figure wat it is.Can anyone help me:-
    PLS-00103: Encountered the symbol "NO" when expecting one of the following: * & = - + ; < / > at in is mod remainder not rem return returning <an exponent (**)> <> or != or ~= >= <= <> and or like LIKE2_ LIKE4_ LIKEC_ between into using || bulk member SUBMULTISET_

    Please use tags when posting code. Also please format the code so that blocks line up vertically - often that makes syntax errors like missing END IFs etc much easier to spot.                                                                                                                                                                                                                                                                                                                                                                           

  • PLS-00103: Encountered the symbol "SELECT" when expecting one of the follow

    Can any one tell me why I an getting compile error in Trigger with the following code (see below for the error message). Error is indicated in the IF statement Select clause.
    Code:
    -- AUdit Code Begin
    -- Note: Ony for those tables having 'AUDIT' UDP
    -- Value set to 'T'
    IF (Select Count(*) From DBConfiguration
    Where ConfigurationCode = 'AUDIT' AND
    ConfigurationValue = 'T') > 0 THEN
    WHEN (:new.WORKREQUESTSTATUS <> :old.WORKREQUESTSTATUS)
    Begin
    Insert INTO ADAMChangeAudit (ADAMChangeAuditKey,AuditTable,AuditRecordKey,AuditColumnName,AuditOldValue,AuditNewValue,AuditUser)
    VALUES(ADAMChangeAuditKey.NextValue,'WORKREQUEST',:new.WORKREQUESTKEY,'WORKREQUESTSTATUS',
    :old.WORKREQUESTSTATUS,:new.WORKREQUESTSTATUS,:new.UserId)
    End;
    WHEN (:new.WORKREQUESTSOURCE <> :old.WORKREQUESTSOURCE)
    Begin
    Insert INTO ADAMChangeAudit (ADAMChangeAuditKey,AuditTable,AuditRecordKey,AuditColumnName,AuditOldValue,AuditNewValue,AuditUser)
    VALUES(ADAMChangeAuditKey.NextValue,'WORKREQUEST',:new.WORKREQUESTKEY,'WORKREQUESTSOURCE',
    :old.WORKREQUESTSOURCE,:new.WORKREQUESTSOURCE,:new.UserId)
    End;
    WHEN (:new.WORKREQUESTSOURCEID <> :old.WORKREQUESTSOURCEID)
    Begin
    Insert INTO ADAMChangeAudit (ADAMChangeAuditKey,AuditTable,AuditRecordKey,AuditColumnName,AuditOldValue,AuditNewValue,AuditUser)
    VALUES(ADAMChangeAuditKey.NextValue,'WORKREQUEST',:new.WORKREQUESTKEY,'WORKREQUESTSOURCEID',
    :old.WORKREQUESTSOURCEID,:new.WORKREQUESTSOURCEID,:new.UserId)
    End;
    WHEN (:new.WORKREQUESTDESC <> :old.WORKREQUESTDESC)
    Begin
    Insert INTO ADAMChangeAudit (ADAMChangeAuditKey,AuditTable,AuditRecordKey,AuditColumnName,AuditOldValue,AuditNewValue,AuditUser)
    VALUES(ADAMChangeAuditKey.NextValue,'WORKREQUEST',:new.WORKREQUESTKEY,'WORKREQUESTDESC',
    :old.WORKREQUESTDESC,:new.WORKREQUESTDESC,:new.UserId)
    End;
    WHEN (:new.WORKREQUESTDATE <> :old.WORKREQUESTDATE)
    Begin
    Insert INTO ADAMChangeAudit (ADAMChangeAuditKey,AuditTable,AuditRecordKey,AuditColumnName,AuditOldValue,AuditNewValue,AuditUser)
    VALUES(ADAMChangeAuditKey.NextValue,'WORKREQUEST',:new.WORKREQUESTKEY,'WORKREQUESTDATE',
    CAST(:old.WORKREQUESTDATE AS varchar2(256)),CAST(:new.WORKREQUESTDATE AS varchar2(256)),:new.UserId)
    End;
    WHEN (:new.WORKREQUESTOWNER <> :old.WORKREQUESTOWNER)
    Begin
    Insert INTO ADAMChangeAudit (ADAMChangeAuditKey,AuditTable,AuditRecordKey,AuditColumnName,AuditOldValue,AuditNewValue,AuditUser)
    VALUES(ADAMChangeAuditKey.NextValue,'WORKREQUEST',:new.WORKREQUESTKEY,'WORKREQUESTOWNER',
    :old.WORKREQUESTOWNER,:new.WORKREQUESTOWNER,:new.UserId)
    End;
    WHEN (:new.WORKREQUESTAPPCODE <> :old.WORKREQUESTAPPCODE)
    Begin
    Insert INTO ADAMChangeAudit (ADAMChangeAuditKey,AuditTable,AuditRecordKey,AuditColumnName,AuditOldValue,AuditNewValue,AuditUser)
    VALUES(ADAMChangeAuditKey.NextValue,'WORKREQUEST',:new.WORKREQUESTKEY,'WORKREQUESTAPPCODE',
    :old.WORKREQUESTAPPCODE,:new.WORKREQUESTAPPCODE,:new.UserId)
    End;
    WHEN (:new.WORKREQUESTAPPROVER <> :old.WORKREQUESTAPPROVER)
    Begin
    Insert INTO ADAMChangeAudit (ADAMChangeAuditKey,AuditTable,AuditRecordKey,AuditColumnName,AuditOldValue,AuditNewValue,AuditUser)
    VALUES(ADAMChangeAuditKey.NextValue,'WORKREQUEST',:new.WORKREQUESTKEY,'WORKREQUESTAPPROVER',
    :old.WORKREQUESTAPPROVER,:new.WORKREQUESTAPPROVER,:new.UserId)
    End;
    WHEN (:new.WORKREQUESTAPPDATE <> :old.WORKREQUESTAPPDATE)
    Begin
    Insert INTO ADAMChangeAudit (ADAMChangeAuditKey,AuditTable,AuditRecordKey,AuditColumnName,AuditOldValue,AuditNewValue,AuditUser)
    VALUES(ADAMChangeAuditKey.NextValue,'WORKREQUEST',:new.WORKREQUESTKEY,'WORKREQUESTAPPDATE',
    CAST(:old.WORKREQUESTAPPDATE AS varchar2(256)),CAST(:new.WORKREQUESTAPPDATE AS varchar2(256)),:new.UserId)
    End;
    WHEN (:new.WORKREQUESTCOMMENT <> :old.WORKREQUESTCOMMENT)
    Begin
    Insert INTO ADAMChangeAudit (ADAMChangeAuditKey,AuditTable,AuditRecordKey,AuditColumnName,AuditOldValue,AuditNewValue,AuditUser)
    VALUES(ADAMChangeAuditKey.NextValue,'WORKREQUEST',:new.WORKREQUESTKEY,'WORKREQUESTCOMMENT',
    :old.WORKREQUESTCOMMENT,:new.WORKREQUESTCOMMENT,:new.UserId)
    End;
    WHEN (:new.CLOSEDATE <> :old.CLOSEDATE)
    Begin
    Insert INTO ADAMChangeAudit (ADAMChangeAuditKey,AuditTable,AuditRecordKey,AuditColumnName,AuditOldValue,AuditNewValue,AuditUser)
    VALUES(ADAMChangeAuditKey.NextValue,'WORKREQUEST',:new.WORKREQUESTKEY,'CLOSEDATE',
    CAST(:old.CLOSEDATE AS varchar2(256)),CAST(:new.CLOSEDATE AS varchar2(256)),:new.UserId)
    End;
    WHEN (:new.ANALYTEKEY <> :old.ANALYTEKEY)
    Begin
    Insert INTO ADAMChangeAudit (ADAMChangeAuditKey,AuditTable,AuditRecordKey,AuditColumnName,AuditOldValue,AuditNewValue,AuditUser)
    VALUES(ADAMChangeAuditKey.NextValue,'WORKREQUEST',:new.WORKREQUESTKEY,'ANALYTEKEY',
    CAST(:old.ANALYTEKEY AS varchar2(256)),CAST(:new.ANALYTEKEY AS varchar2(256)),:new.UserId)
    End;
    WHEN (:new.SUBPURPOSEKEY <> :old.SUBPURPOSEKEY)
    Begin
    Insert INTO ADAMChangeAudit (ADAMChangeAuditKey,AuditTable,AuditRecordKey,AuditColumnName,AuditOldValue,AuditNewValue,AuditUser)
    VALUES(ADAMChangeAuditKey.NextValue,'WORKREQUEST',:new.WORKREQUESTKEY,'SUBPURPOSEKEY',
    CAST(:old.SUBPURPOSEKEY AS varchar2(256)),CAST(:new.SUBPURPOSEKEY AS varchar2(256)),:new.UserId)
    End;
    WHEN (:new.PURPOSEKEY <> :old.PURPOSEKEY)
    Begin
    Insert INTO ADAMChangeAudit (ADAMChangeAuditKey,AuditTable,AuditRecordKey,AuditColumnName,AuditOldValue,AuditNewValue,AuditUser)
    VALUES(ADAMChangeAuditKey.NextValue,'WORKREQUEST',:new.WORKREQUESTKEY,'PURPOSEKEY',
    CAST(:old.PURPOSEKEY AS varchar2(256)),CAST(:new.PURPOSEKEY AS varchar2(256)),:new.UserId)
    End;
    End if;
    -- Audit End
    Error:
    95/5 PLS-00103: Encountered the symbol "SELECT" when expecting one of the following:
    ( - + case mod new not null others <an identifier>
    <a double-quoted delimited-identifier> <a bind variable> avg
    count current exists max min prior sql stddev sum variance
    execute forall merge time timestamp interval date
    <a string literal with character set specification>
    <a number> <a single-quoted SQL string> pipe
    <an alternatively-quoted string literal with character set specification>
    <an alternativ
    97/39 PLS-00103: Encountered the symbol ")" when expecting one of the following:
    * & - + ; / at for mod remainder rem <an exponent (**)> and
    or group having intersect minus order start union where
    connect || multiset

    Here is the code:
    -- AUdit Code Begin
    -- Note: Ony for those tables having 'AUDIT' UDP
    -- Value set to 'T'
    IF (Select Count(DBConfigurationValue) From DBConfiguration
    Where DBConfigurationCode = 'AUDIT' AND
    DBConfigurationValue = 'T') > 0 THEN
    WHEN (:new.WORKREQUESTSTATUS <> :old.WORKREQUESTSTATUS)
    Begin
    Insert INTO ADAMChangeAudit (ADAMChangeAuditKey,AuditTable,AuditRecordKey,AuditColumnName,AuditOldValue,AuditNewValue,AuditUser)
    VALUES(ADAMChangeAuditKey.NextValue,'WORKREQUEST',:new.WORKREQUESTKEY,'WORKREQUESTSTATUS',
    :old.WORKREQUESTSTATUS,:new.WORKREQUESTSTATUS,:new.UserId)
    End;
    WHEN (:new.WORKREQUESTSOURCE <> :old.WORKREQUESTSOURCE)
    Begin
    Insert INTO ADAMChangeAudit (ADAMChangeAuditKey,AuditTable,AuditRecordKey,AuditColumnName,AuditOldValue,AuditNewValue,AuditUser)
    VALUES(ADAMChangeAuditKey.NextValue,'WORKREQUEST',:new.WORKREQUESTKEY,'WORKREQUESTSOURCE',
    :old.WORKREQUESTSOURCE,:new.WORKREQUESTSOURCE,:new.UserId)
    End;
    WHEN (:new.WORKREQUESTSOURCEID <> :old.WORKREQUESTSOURCEID)
    Begin
    Insert INTO ADAMChangeAudit (ADAMChangeAuditKey,AuditTable,AuditRecordKey,AuditColumnName,AuditOldValue,AuditNewValue,AuditUser)
    VALUES(ADAMChangeAuditKey.NextValue,'WORKREQUEST',:new.WORKREQUESTKEY,'WORKREQUESTSOURCEID',
    :old.WORKREQUESTSOURCEID,:new.WORKREQUESTSOURCEID,:new.UserId)
    End;
    WHEN (:new.WORKREQUESTDESC <> :old.WORKREQUESTDESC)
    Begin
    Insert INTO ADAMChangeAudit (ADAMChangeAuditKey,AuditTable,AuditRecordKey,AuditColumnName,AuditOldValue,AuditNewValue,AuditUser)
    VALUES(ADAMChangeAuditKey.NextValue,'WORKREQUEST',:new.WORKREQUESTKEY,'WORKREQUESTDESC',
    :old.WORKREQUESTDESC,:new.WORKREQUESTDESC,:new.UserId)
    End;
    WHEN (:new.WORKREQUESTDATE <> :old.WORKREQUESTDATE)
    Begin
    Insert INTO ADAMChangeAudit (ADAMChangeAuditKey,AuditTable,AuditRecordKey,AuditColumnName,AuditOldValue,AuditNewValue,AuditUser)
    VALUES(ADAMChangeAuditKey.NextValue,'WORKREQUEST',:new.WORKREQUESTKEY,'WORKREQUESTDATE',
    CAST(:old.WORKREQUESTDATE AS varchar2(256)),CAST(:new.WORKREQUESTDATE AS varchar2(256)),:new.UserId)
    End;
    WHEN (:new.WORKREQUESTOWNER <> :old.WORKREQUESTOWNER)
    Begin
    Insert INTO ADAMChangeAudit (ADAMChangeAuditKey,AuditTable,AuditRecordKey,AuditColumnName,AuditOldValue,AuditNewValue,AuditUser)
    VALUES(ADAMChangeAuditKey.NextValue,'WORKREQUEST',:new.WORKREQUESTKEY,'WORKREQUESTOWNER',
    :old.WORKREQUESTOWNER,:new.WORKREQUESTOWNER,:new.UserId)
    End;
    WHEN (:new.WORKREQUESTAPPCODE <> :old.WORKREQUESTAPPCODE)
    Begin
    Insert INTO ADAMChangeAudit (ADAMChangeAuditKey,AuditTable,AuditRecordKey,AuditColumnName,AuditOldValue,AuditNewValue,AuditUser)
    VALUES(ADAMChangeAuditKey.NextValue,'WORKREQUEST',:new.WORKREQUESTKEY,'WORKREQUESTAPPCODE',
    :old.WORKREQUESTAPPCODE,:new.WORKREQUESTAPPCODE,:new.UserId)
    End;
    WHEN (:new.WORKREQUESTAPPROVER <> :old.WORKREQUESTAPPROVER)
    Begin
    Insert INTO ADAMChangeAudit (ADAMChangeAuditKey,AuditTable,AuditRecordKey,AuditColumnName,AuditOldValue,AuditNewValue,AuditUser)
    VALUES(ADAMChangeAuditKey.NextValue,'WORKREQUEST',:new.WORKREQUESTKEY,'WORKREQUESTAPPROVER',
    :old.WORKREQUESTAPPROVER,:new.WORKREQUESTAPPROVER,:new.UserId)
    End;
    WHEN (:new.WORKREQUESTAPPDATE <> :old.WORKREQUESTAPPDATE)
    Begin
    Insert INTO ADAMChangeAudit (ADAMChangeAuditKey,AuditTable,AuditRecordKey,AuditColumnName,AuditOldValue,AuditNewValue,AuditUser)
    VALUES(ADAMChangeAuditKey.NextValue,'WORKREQUEST',:new.WORKREQUESTKEY,'WORKREQUESTAPPDATE',
    CAST(:old.WORKREQUESTAPPDATE AS varchar2(256)),CAST(:new.WORKREQUESTAPPDATE AS varchar2(256)),:new.UserId)
    End;
    WHEN (:new.WORKREQUESTCOMMENT <> :old.WORKREQUESTCOMMENT)
    Begin
    Insert INTO ADAMChangeAudit (ADAMChangeAuditKey,AuditTable,AuditRecordKey,AuditColumnName,AuditOldValue,AuditNewValue,AuditUser)
    VALUES(ADAMChangeAuditKey.NextValue,'WORKREQUEST',:new.WORKREQUESTKEY,'WORKREQUESTCOMMENT',
    :old.WORKREQUESTCOMMENT,:new.WORKREQUESTCOMMENT,:new.UserId)
    End;
    WHEN (:new.CLOSEDATE <> :old.CLOSEDATE)
    Begin
    Insert INTO ADAMChangeAudit (ADAMChangeAuditKey,AuditTable,AuditRecordKey,AuditColumnName,AuditOldValue,AuditNewValue,AuditUser)
    VALUES(ADAMChangeAuditKey.NextValue,'WORKREQUEST',:new.WORKREQUESTKEY,'CLOSEDATE',
    CAST(:old.CLOSEDATE AS varchar2(256)),CAST(:new.CLOSEDATE AS varchar2(256)),:new.UserId)
    End;
    WHEN (:new.ANALYTEKEY <> :old.ANALYTEKEY)
    Begin
    Insert INTO ADAMChangeAudit (ADAMChangeAuditKey,AuditTable,AuditRecordKey,AuditColumnName,AuditOldValue,AuditNewValue,AuditUser)
    VALUES(ADAMChangeAuditKey.NextValue,'WORKREQUEST',:new.WORKREQUESTKEY,'ANALYTEKEY',
    CAST(:old.ANALYTEKEY AS varchar2(256)),CAST(:new.ANALYTEKEY AS varchar2(256)),:new.UserId)
    End;
    WHEN (:new.SUBPURPOSEKEY <> :old.SUBPURPOSEKEY)
    Begin
    Insert INTO ADAMChangeAudit (ADAMChangeAuditKey,AuditTable,AuditRecordKey,AuditColumnName,AuditOldValue,AuditNewValue,AuditUser)
    VALUES(ADAMChangeAuditKey.NextValue,'WORKREQUEST',:new.WORKREQUESTKEY,'SUBPURPOSEKEY',
    CAST(:old.SUBPURPOSEKEY AS varchar2(256)),CAST(:new.SUBPURPOSEKEY AS varchar2(256)),:new.UserId)
    End;
    WHEN (:new.PURPOSEKEY <> :old.PURPOSEKEY)
    Begin
    Insert INTO ADAMChangeAudit (ADAMChangeAuditKey,AuditTable,AuditRecordKey,AuditColumnName,AuditOldValue,AuditNewValue,AuditUser)
    VALUES(ADAMChangeAuditKey.NextValue,'WORKREQUEST',:new.WORKREQUESTKEY,'PURPOSEKEY',
    CAST(:old.PURPOSEKEY AS varchar2(256)),CAST(:new.PURPOSEKEY AS varchar2(256)),:new.UserId)
    End;
    End if;

  • Bug causing PLS-00103 error

    The following anonymous block works fine
    begin
    null;
    end;
    /but if I add a space between "end" and ";", like this
    begin
    null;
    end ;
    /I get ORA-06550 and "PLS-00103: Encountered the symbol "end-of-file" when expecting one of the following ..." errors.
    I'm running version 1.5.4, Build MAIN-5940, on Windows XP.

    racist!
    No, really, the two should behave in the same manner, so if the syntax is correct (which is), both should work. As F9 doesn't, it's a bug.
    Regards,
    K.

  • PLS-00103 error

    can you please tell me what am i missing. i am getting below error.
    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 am i missing. i am getting below error.
    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
    BEGINremove "BEGIN" from line above

  • PLS-00103 Error While Creating Procedure

    I am attempting to create the following procedure following the guidelines in Metalink Doc ID #118040.1 and I keep receiving the following error at Line #22:
    Error(22,65): PLS-00103: Encountered the symbol ":" when expecting one of the following: := . ( % ; The symbol ":= was inserted before ":" to continue.
    Here is my procedure code:
    PROCEDURE sw_load_image( position IN NUMBER, filename VARCHAR2) AS
    f_lob BFILE;
         b_lob BLOB;
         image_name VARCHAR2(30);
         mime_type VARCHAR2(30);
         dot_pos NUMBER;
    BEGIN
    -- Find the position of the dot ('.') located in the filename
         dot_pos := INSTR(filename, '.');
         -- Get the filename without extension and use it as image name
         image_name := SUBSTR(filename,1,dot_pos-1);
         -- Build the mime type. Retrieve the file extension and add it to 'image/'
         mime_type := 'image/'||SUBSTR( filename, dot_pos+1, length(filename) );
         INSERT INTO sw_images values(position, image_name, mime_type, empty_blob() ) RETURN img_data INTO b_lob;
         f_lob := BFILENAME('IMG2LOAD', filename);
         dbms_lob.fileopen(f_lob, dbms_lob.file_readonly);
         dbms_lob.loadfromfile(b_lob, f_lob, dbms_lob.getlength(f_lob) ):
         dbms_lob.fileclose(f_lob);
         COMMIT;
    END;
    Line #22 is the line that starts 'dbms_lob.loadfromfile'. I am not seeing where I have made a mistake. Does anyone else see where I've made a mistake?
    This procedure is being created on a 9i database running on W2K server and W2K client.
    Thanks,
    Jason

    Thanks! As many times as I looked at that I can't believe I didn't see that. Thanks again.

Maybe you are looking for

  • Can't sync iPhone... Apple Mobile Device support does not install

    Hello @all, I've got a big problem. I've installed the 8.1 Update of Itunes and Apple Mobile Device Service would not be installed. After registering modules the setup reverses all actions. Now I can start Itunes but my IPhone can't sync. Theres a Ge

  • Cancelled mavericks download - lost all HP software

    Greetings, I have a desktop mac that's a few years old and running OSX 10.6.8. Since Mavericks can supposedly be downloaded for free even if you're running 10.6.8, I tried. And I repeatedly tried and each time hours would go by with no change in the

  • Problems mounting Hitachi 7k3000 HDD in Voyager Q dock via eSATA

    I have two NewerTech Voyager Q- Quad Interface SATA 2.5" & 3.5" Drive Docks http://eshop.macsales.com/item/NewerTech/FWU3ES2HDK/ from OWC.com that are advertised as compatible with 3TB SATA III Hitachi drives. I am using one as a main data drive, and

  • Problem in SPACE_USAGE Procedure

    1 begin 2 dbms_space.space_usage('LIVE', 'OE_PAYMENTS','OE_PAYMENTS_7', 'TABLE PARTITION', 3 :unf, :unfb, 4 :fs1, :fs1b, 5 :fs2, :fs2b, 6 :fs3, :fs3b, 7 :fs4, :fs4b, 8 :full, :fullb); 9* end; dbms_space.space_usage('LIVE', 'OE_PAYMENTS','OE_PAYMENTS_

  • I can't import two new CDs to iTunes on my iMac

    I purchased two CDs from Barnes & Noble: Steve Miller Band - Greatest Hits 1974-78 and Mylo Kyloto (by Coldplay). I tried to import them to iTunes 10 on my 20" iMac running OS X Lion, but the following error appears: The file "____" cannot be convert