Home » Developer & Programmer » Forms » Procedure (Oracle,D2k)
Procedure [message #529823] Thu, 03 November 2011 04:18 Go to next message
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 messageGo to next message
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 messageGo to next message
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:
prc_test;


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

Re: Procedure [message #529828 is a reply to message #529827] Thu, 03 November 2011 04:33 Go to previous message
cookiemonster
Messages: 13937
Registered: September 2008
Location: Rainy Manchester
Senior Member
Ooops
Previous Topic: how to attach usb scanner with Oracle forms
Next Topic: how to display images from any drive in oracle froms and i want to save the images in database als
Goto Forum:
  


Current Time: Sat Sep 07 12:54:38 CDT 2024