Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

function returning error text validation

645872Oct 21 2008 — edited Oct 22 2008
Hi,

I have a page where i can insert/update user, organisation, responsible.
Organisation can be nullable.

Only one user at a time can be responsible for a organisation.

To check this responsible validation i made a function returning error text validation as follow:

BEGIN
FOR c IN (SELECT usr_spa
FROM kpi_users
WHERE usr_org_id = :p22_usr_org_id
)
LOOP
IF upper(:p22_usr_spa) = upper('YES') and upper(c.usr_spa) = upper('YES')
THEN
RETURN 'A user is already responsible for this organisation'||'!';
END IF;

END LOOP;

END;

The validation works fine.

But it goes wrong when i want to insert a new user, without assigning him to an organisation.
I get following message:

ORA-01722: invalid number

ERR-1024 Unable to run "function body returning text" validation.

Can someone please help me solve this problem?

Thanks
This post has been answered by ATD on Oct 22 2008
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 19 2008
Added on Oct 21 2008
10 comments
701 views