Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2004
    Location
    Germany
    Posts
    136

    Unanswered: PLS-00103 ? Syntax-Error creating a procedure

    Hello All!

    Compiling the following procedure:

    PHP Code:
    CREATE OR REPLACE PROCEDURE PRC_CHECK_AVAIL_EXPIRED  
    (         pIdFeature FEATURE_AVAILABLE.ID_FEATURE%TYPE
    )
    AS
             
    DateExpired DATE;
           
    NumDays     NUMBER;
    BEGIN     
         
        EXECUTE IMMEDIATE 
    'SELECT EXPIRE_DATE FROM FEATURE_AVAILABLE WHERE ID_FEATURE = ' || pIdFeature INTO DateExpired;     
        
    EXECUTE IMMEDIATE 'SELECT SYSDATE, round(DateExpired - SYSDATE) FROM DUAL INTO ' || NumDays;
     
        IF 
    NumDays 3 Then
           UPDATE FEATURE_AVAILABLE SET CHANGED_ON 
    SYSDATE WHERE ID_FEATURE pIdFeature;
        
    /*LINE 14*/ELSIF (NumDays := 3) AND (NumDays 0)  THEN
            UPDATE FEATURE_AVAILABLE SET CHANGED_ON 
    SYSDATE WHERE ID_FEATURE pIdFeature;
           
    /*LINE 16*/ELSIF Numdays := 0  THEN
            UPDATE FEATURE_AVAILABLE SET CHANGED_ON 
    SYSDATE WHERE ID_FEATURE pIdFeature;
        
    ELSIF Numdays 0  THEN
              INSERT INTO NOT_AVAILABLE_EXPIRED  
    (
                                
    ID_FEATUREEXPIRE_DATE
                        
    CREATED_ONCREATED_BYCHANGED_ONCHANGED_BY)     
                     
    VALUES (pIdFeatureDateExpiredSYSDATEUSERSYSDATEUSER);        
        ELSE
            
    RAISE_APPLICATION_ERROR(-12345,'Expired Date Definition Error');
        
    END IF;
    END;

    i've got these errors:




    LINE 14: PLS-00103: Encountered the symbol "=" when expecting one of the following:

    . ( ) , * @ % & | = - + < / > at in mod not range rem => ..

    LINE 14: PLS-00103: Encountered the symbol "THEN" when expecting one of the following:

    ) , * & = - + < / > at in mod not rem <an exponent (**)>

    LINE 16: PLS-00103: Encountered the symbol "=" when expecting one of the following:

    ) , * & = - + < / > at in mod not rem <an exponent (**)>



    What can i modify?


    Thanks in advance!
    Regards,
    Julia

  2. #2
    Join Date
    Apr 2004
    Location
    USA
    Posts
    33
    You don't need the assignment operator := for comparison in your ELSIF statement, i.e. change to ELSIF NumDays = 3 instead of NumDays := 3.

  3. #3
    Join Date
    Feb 2004
    Location
    Germany
    Posts
    136
    Thanks!
    ..
    ELSIF NumDays = 3 AND NumDays > 0 THEN ..
    ELSIF Numdays = 0 THEN ..

    works.
    Regards,
    Julia

  4. #4
    Join Date
    Mar 2004
    Posts
    23
    Your 2nd EXECUTE IMMEDIATE seems unnecessary:

    NumDays := round(DateExpired - SYSDATE);

    and you're selecting 2 items but INTO only one.

    Also your 3 UPDATE statements all seem to do the same thing.

  5. #5
    Join Date
    Feb 2004
    Location
    Germany
    Posts
    136
    Thank you , Lluf,

    You're right: sysdate-statement was not correct!

    My UPDATE-statements are just an alternative for procedures that i haven't yet created.
    Regards,
    Julia

Posting Permissions

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