Home » Developer & Programmer » Forms » Forms 4.5 calling function defined in database package not working
Forms 4.5 calling function defined in database package not working [message #144292] Tue, 25 October 2005 16:36 Go to next message
Wade
Messages: 5
Registered: October 2005
Location: Pittsburgh
Junior Member
Hello,

I have a database package with functions defined that return NUMBER;

I am trying to call the function from oracle forms 4.5, but do not seem to get any data back.

I tested from sqlplus and it worked fine.

Is there any restrictions or special way you need to call a function defined in database package from a form.

in form I call the function as....

BEGIN
:blockname.fieldname := package_name.function_name(a,b,c);
END;

Thanks for your help!!!
Wade

Re: Forms 4.5 calling function defined in database package not working [message #144310 is a reply to message #144292] Tue, 25 October 2005 20:34 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Try:
BEGIN
   select package_name.function_name (a, b, c)
     into :blockname.fieldname
     from dual;
END;

But your code should have worked.

Is function_name defined in the specification section of the package?

Are you running as the owner of the package? If not then the new user will need permission to use the package.

David

[Updated on: Tue, 25 October 2005 20:35]

Report message to a moderator

Re: Forms 4.5 calling function defined in database package not working [message #144615 is a reply to message #144310] Thu, 27 October 2005 07:17 Go to previous messageGo to next message
Wade
Messages: 5
Registered: October 2005
Location: Pittsburgh
Junior Member
Hello,
The function_name is defined in the specification section of the package and I am running as owner of the package. I can run it as a function in the database, not in a package, and that works just fine (which was my solution... although I am very curious why packaged functions are not working)

I was unable to run your suggestion also (even in sqlplus). received the following error...

ERROR at line 1:
ORA-06571: Function PA_INV_AMT_DATE_F does not guarantee not to update database

Any suggestions.
Thanks for your help.

Re: Forms 4.5 calling function defined in database package not working [message #144725 is a reply to message #144615] Thu, 27 October 2005 18:43 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Is PA_INV_AMT_DATE_F your function? If you know that it DOES NOT update the database then add "PRAGMA RESTRICT_REFERENCES (PA_INV_AMT_DATE_F,WNDS);" to your package specification.

PLEASE read the documentation on PRAGMA and see which of the other three settings you can use.

David
Previous Topic: form trigger
Next Topic: attaching triggers to form
Goto Forum:
  


Current Time: Fri Sep 20 00:39:09 CDT 2024