Home » Developer & Programmer » Forms » Run a procedure in a form (form developer 6i second release)
Run a procedure in a form [message #282915] Sun, 25 November 2007 01:23 Go to next message
ashraf_al_ani
Messages: 92
Registered: October 2007
Location: Iraq
Member
Dear all
Ive wrote a procedure in the DB as

CREATE OR REPLACE PROCEDURE TEST.dd (d in number) IS
begin delete from emp where sex=d;
END dd;


I want to run this procedure in a form and the parameter (d)
I want to enter it by a text item
so pls help me

best wishes
Re: Run a procedure in a form [message #282941 is a reply to message #282915] Sun, 25 November 2007 07:12 Go to previous messageGo to next message
Littlefoot
Messages: 20901
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Just call the procedure as you'd do it in any PL/SQL block; you, probably, already have a text item of the NUMBER datatype - let's call it 'd_to_delete'. Call the procedure from a form trigger (for example, create additional PUSH BUTTON with a label "Delete 'd'") and put such a code into it:
dd (:d_to_delete);

Don't forget to COMMIT changes you've made in order to reflect them in the database.
Re: Run a procedure in a form [message #283041 is a reply to message #282915] Mon, 26 November 2007 00:22 Go to previous messageGo to next message
ashraf_al_ani
Messages: 92
Registered: October 2007
Location: Iraq
Member
Dear friend

Ive wrote it as
dd(Very Happy);
commit;

where dd is the name of the procedure and d is the name of the text item and also it is the name of the parameter in the procedure in the DB
I entered 1 in the text item and there is a record contains 1 in sex field but it didnt delete
please your advice

best wishes
Re: Run a procedure in a form [message #283043 is a reply to message #282915] Mon, 26 November 2007 00:24 Go to previous messageGo to next message
ashraf_al_ani
Messages: 92
Registered: October 2007
Location: Iraq
Member
sorry for the mistake
ive wrote dd(:name of the text item)
but it displayes as a happy face because its name is d

best wishes
Re: Run a procedure in a form [message #283115 is a reply to message #283043] Mon, 26 November 2007 02:50 Go to previous messageGo to next message
Littlefoot
Messages: 20901
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Well, it does work for me.

Where did you put
dd(:d);
commit;
Which trigger was it? Did the trigger fire? If you are not sure of it, put a MESSAGE statement so that you'll be informed about it:
message('I am going to call the DD procedure now. Parameter is ' || :d);
dd (:d);
commit;
message('Returned from DD');
Re: Run a procedure in a form [message #283786 is a reply to message #282915] Wed, 28 November 2007 02:48 Go to previous message
ashraf_al_ani
Messages: 92
Registered: October 2007
Location: Iraq
Member
many many thanks it has been solved
thanks for your advice brother

Previous Topic: Measure length of string in Inches
Next Topic: Dynamically assign value to an item in a block
Goto Forum:
  


Current Time: Thu Dec 08 16:27:33 CST 2016

Total time taken to generate the page: 0.17642 seconds