Skip to Main Content

Oracle Forms

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!

Calling a function from Oracle forms

Zenami1Aug 28 2017 — edited Sep 13 2017

I am using Oracle Forms 6i with Oracle db 10g on a Windows machine, in a form, when i click on a button, the trigger WHEN-BUTTON-PRESSED is launched calling a function of a package in the database, Here is the PL/SQL code for both the trigger and the function:

The function:

Function test_function (code Varchar2) RETURN Varchar2 IS 
BEGIN if code IN ('Y') then
     return('Yes');
else
     return('no');
endif
;
END;

The trigger:

DECLARE
     message_test varchar2(20);
BEGIN
     message_test := pkg_test.test_function('Y');
     message
('the message is: ' || message_test);pause;
END;

My problem here is that it doesn't show anything, but when i write pkg_test.test_function('Y') in sql*plus or in SqlDevelopper it shows 'Yes' as a result,

Or when i change message_test := pkg_test.test_function('Y'); with select pkg_test.test_function('Y') into message_test from test; it works also.

what might be the cause of that?

PS: this is just a test code, the actual code is more complex than that.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 11 2017
Added on Aug 28 2017
18 comments
5,348 views