Home > Software design >  Function returning error texts in Oracle APEX
Function returning error texts in Oracle APEX

Time:11-23

I am trying to take a count of the records in the interactive grid and based on that I am trying to pass a message to the user. However, I am getting error : ORA-06550: line 1, column 141: PLS-00103: Encountered the symbol "NUMBER" when expecting one of the following: := . ( @ % ; The symbol "." was substituted for "NUMBER" to continue.Following is my code in the validation. Validation Type is : Function Returning Error Text.

l_count NUMBER := 0;

BEGIN

  SELECT COUNT(1)
      INTO l_count
      FROM  ugh
     WHERE ugh.pre = :PRE
       AND ugh.APP1 = :APP1
       AND ugh.APP2 = :APP2
       AND ugh.APP3 = :APP3
       AND ugh.FINL_APP = :FINL_APP;
 
IF l_count > 1 THEN
      IF END_DATE IS NULL THEN
         RETURN 'Error Message to be displayed.';
      ELSE
      RETURN NULL;
      END IF;
    ELSE
     RETURN NULL;
   END IF;
END;

Can anyone please help ?

CodePudding user response:

Looks like you're missing the DECLARE keyword:

DECLARE                           --> this
   l_count  NUMBER := 0;
BEGIN
   SELECT COUNT (1)
     INTO l_count
     FROM ugh

Also, what is END_DATE? You never declared it. If it is a page item, then precede it with a colon, :END_DATE

  • Related