Procedure [message #529823] |
Thu, 03 November 2011 04:18 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
siva123
Messages: 6 Registered: July 2007 Location: chennai
|
Junior Member |
|
|
I am creating a procedure oracle forms and data base ...Which one is fires first ...
If suppose i need data base fires first ..
What is the process
|
|
|
Re: Procedure [message #529825 is a reply to message #529823] |
Thu, 03 November 2011 04:26 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
cookiemonster
Messages: 13937 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
If you have a procedure of the same name with the same parameters in a form and in the DB then the one in the form will be run.
The one in the DB will not run at all.
You can run the DB one by prefixing it with the schema name, but then the one in the form won't run.
First doesn't come into it.
Personally I'd make sure I never had a form with a procedure of the same name as a db procedure, it avoids confusion.
|
|
|
Re: Procedure [message #529827 is a reply to message #529823] |
Thu, 03 November 2011 04:31 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](http://www.orafaq.com/forum/images/custom_avatars/72104.gif) |
Littlefoot
Messages: 21818 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
Create a table and a sequence:create table test (id number, ime varchar2(20));
create sequence seqa;
Then create a form; moreover, create two procedures with the same name: PRC_TEST (one in form's Program Units section, another one in the database):
-- PRC_TEST in a form
PROCEDURE prc_test IS
BEGIN
insert into test (id, ime)
(select seqa.nextval, 'form' from dual);
commit;
END; -- PRC_TEST in a database
create or replace procedure prc_form as
begin
insert into test (id, ime)
(select seqa.nextval, 'db' from dual);
commit;
end;
A form should contain a push button with the following statement in there:
Run the form, push the button. Go to SQL*Plus and SELECT from the TEST table. What do you see?
Bah! While I was trying to make the OP do some tests, Cookie spoiled the party.
[Updated on: Thu, 03 November 2011 04:32] Report message to a moderator
|
|
|
|