Program constructs [message #2500] |
Sun, 21 July 2002 03:23 |
Pascal
Messages: 7 Registered: October 2001
|
Junior Member |
|
|
Hi people,
I need to know what is
1 Anonymous block
2 Application trigger
3 Database trigger
4 Stored procedure
5 application procedure
6 packaged procedure
could you please contrast each six program constructs, when are they being used and what application areas are they used
Thx in advance
|
|
|
Re: Program constructs [message #2516 is a reply to message #2500] |
Mon, 22 July 2002 22:26 |
|
Maaher
Messages: 7065 Registered: December 2001
|
Senior Member |
|
|
1 Anonymous block
A PL/SQL program unit that's not stored in the database and has no name (hence: anymous).
e.g.:
DECLARE
x number := 0;
BEGIN
x := x + 2;
-- perform some more actions here...
...
END;
/
These are ran from an SQL environment, mostly SQL/Plus.
2 Application trigger
A trigger fires when a certain event occurs. An application trigger fires when this even takes place within the application. For example, in Oracle Forms, a PRE-INSERT trigger on a certain block fires automatically (if you don't do anything fancy with the properties) when you have created a new record and want to save it to the database. Before the actual insert vs. the database is done, the PRE-INSERT fires. The Forms manual provides more info.
3 Database trigger
A database trigger fires when a certain event occurs in the database. You have two kinds of triggers in the database: system event triggers (AFTER-LOGON,...) and object event triggers ( BEFORE INSERT, INSTEAD OF UPDATE...). The Oracle Manual can give you a thourough insight in this matter.
4 Stored procedure
A stored procedure is a named PL/SQL program unit stored in the database.
5 application procedure
Also a named program unit, but this time, stored in the application and not in the database.
6 packaged procedure
A package is a "collection" of stored procedures. It consists of a header (public part) and a body (private part). All declarations should first be made in the header and then again in the body. But the body also contains program logic.
This is a rough and short overview but If you go to otn.oracle.com and browse the documentation area, you sure get the grip. Or you could search the board, I'm sure this question has been asked before...
MHE
|
|
|
Re: Program constructs [message #2532 is a reply to message #2500] |
Wed, 24 July 2002 02:12 |
santosh
Messages: 85 Registered: October 2000
|
Member |
|
|
Hi Maher,
Will u suggest some links on docs where i find more about application trigger and application procedure? (documentation chapter name)
Thanks
Santosh
|
|
|