Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2012
    Posts
    1

    Post Unanswered: Error in Package containing function

    Hi, Here is my package that i am getting error - "PLS-00103: Encountered the symbol "=" when expecting one of the following"

    create or replace package pre_pkg
    is

    FUNCTION FUN_DATE (a_date date)
    RETURN number;

    end pre_pkg;

    create or replace package body pre_pkg
    is

    function FUN_DATE (a_date date)
    return number
    is

    BEGIN

    IF REGEXP_LIKE(a_date,'^\d{1}|d{2}/\d{1}|d{2}/\d{4} \d{2}:\d{2}:\d{2}.\d{3}$')
    AND (REGEXP_INSTR(a_date,'[AP]M',1)=0
    AND LENGTH(a_date) > 11
    AND LENGTH(TRUNC(to_char(TO_TIMESTAMP(a_date,'MM/DD/YYYY HH24:MIS.FF'),'YYYY')))=4)
    THEN
    return := 0;

    ELSIF REGEXP_LIKE(a_date,'^\d{1}|d{2}/\d{1}|d{2}/\d{4} \d{2}:\d{2}:\d{2} [AP]M$')
    AND (REGEXP_INSTR(a_date,'[AP]M',1) > 0
    AND LENGTH(TRUNC(to_char(TO_DATE(a_date,'MM/DD/YYYY HH:MIS AM'),'YYYY')))=4)
    THEN
    return := 0;

    ELSIF REGEXP_LIKE(a_date,'^\d{1}|d{2}/\d{1}|d{2}/\d{4}$')
    AND (REGEXP_INSTR(a_date,'[AP]M',1)=0
    AND LENGTH(TRIM(a_date)) < 11
    AND LENGTH(TRUNC(to_char(TO_DATE(a_date,'MM/DD/YYYY'),'YYYY')))=4)
    THEN
    return := 0;
    ELSE
    return := 1;

    END IF;

    EXCEPTION
    WHEN OTHERS THEN
    return := 1;

    END FUN_DATE;

    END pre_pkg;
    /

    Can any one help me in this regard. I am using oracle 10g.

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    RETURN statement should not contain " :="
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

Posting Permissions

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