Home » Developer & Programmer » Forms » Adding procedures to forms.
Adding procedures to forms. [message #145028] Mon, 31 October 2005 07:57 Go to next message
Sharaf
Messages: 62
Registered: September 2005
Location: U.K
Member
Please i have some stored procedures in my database. and I want them to run when I click a button on my form.

Please is this possible.?

How can I run them from my forms.

thanks
Re: Adding procedures to forms. [message #145093 is a reply to message #145028] Mon, 31 October 2005 19:31 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Just call it (them).

In a When-Button-Pressed trigger
begin
  my_pkg.my_proc(parm1, parm2,parm3);
end;
David

[Updated on: Mon, 31 October 2005 19:31]

Report message to a moderator

Re: Adding procedures to forms. [message #145139 is a reply to message #145093] Tue, 01 November 2005 03:25 Go to previous messageGo to next message
Sharaf
Messages: 62
Registered: September 2005
Location: U.K
Member
thanks for your reply.

I dont have packages but individual procedures.

can i call in dividual procedures and how.?

thanks.
Re: Adding procedures to forms. [message #145150 is a reply to message #145093] Tue, 01 November 2005 05:28 Go to previous messageGo to next message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
djmartin wrote on Tue, 01 November 2005 02:31

Just call it (them).

In a When-Button-Pressed trigger
begin
  my_pkg.my_proc(parm1, parm2,parm3);
end;
David

Like David said: just call them. Only this time you have no package, so it becomes:

In a When-Button-Pressed trigger
begin
  my_proc(parm1, parm2,parm3);
end;


MHE
Re: Adding procedures to forms. [message #145278 is a reply to message #145150] Wed, 02 November 2005 03:07 Go to previous messageGo to next message
Sharaf
Messages: 62
Registered: September 2005
Location: U.K
Member
Thanks for the reply.

I successfully called the procedure and it worked., But I have a little problem here which is the procedure i wrote shown below, works but after updating the particular column it does not commit the updated record, it just display the record in the form when it is run, but when i go to sqlplus. it does not commit the record, and i need it to commit the record because another procedure is working based on the value of the column.

please what do i need to alter in the procedure to make sure it commit the record after running it.



CREATE OR REPLACE PROCEDURE set_daysoverdue
IS
BEGIN
UPDATE LOAN
SET days_overdue =(returndate - enddate)
WHERE returndate > enddate;
END;
Re: Adding procedures to forms. [message #145282 is a reply to message #145278] Wed, 02 November 2005 03:57 Go to previous messageGo to next message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
Your commit processing is controlled in the form, so once you commit the form, your changes are saved.

MHE
Re: Adding procedures to forms. [message #145294 is a reply to message #145028] Wed, 02 November 2005 05:09 Go to previous messageGo to next message
kiran
Messages: 503
Registered: July 2000
Senior Member
For this you could use Commit_Form bulit-in.

--Kiran.
Re: Adding procedures to forms. [message #145394 is a reply to message #145278] Wed, 02 November 2005 17:46 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
If the procedure is in the database then do a 'COMMIT'.

If the procedure is in the Form then do a 'Standard.Commit'.

Search this forum for 'standard.commit' for the reasons why.

David
Previous Topic: Error 500--Internal Server Error
Next Topic: Popup when form is opened.
Goto Forum:
  


Current Time: Fri Sep 20 04:44:46 CDT 2024