Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stored Procedures Oracle 8

Status
Not open for further replies.

NiteCrawlr

Programmer
Mar 16, 2001
140
BR
I'm sorry, but I don't have a lot of experience in working with Oracle. I need some help in creating Stored procedures, which count the TOTAL number of employees (from a vieww). I also need a trigger for that stored procedure (on update and insert)
 
We'll need a little more information here in order to help you.
First, what do want to do with the number of employees once you've counted them.

Secondly, you can't create an insert/update/delete trigger on a view. You have to build the trigger on the table.

Finally, it would probably be more efficient (and possibly more logical) to have the trigger do the counting/processing instead of a separate procedure.

Fill us in a little more and we'll be glad to help!
 
I also don't know exactly what you are trying to do. You can not have a "trigger" on a stored procedure. Your updates and inserts are part of the stored procedure. If you want a total for your view, you can write a function to return your count. This function can be incorporated into a view, if need be. Is is also possible to update and insert via a view. If a simple view (no joins), an insert/update can pass through it. If a complex view, then an "Instead Of Trigger" can be used. When an insert/update is applied to the complex view, this trigger takes over processing. A bit of advice, trigger should not have very much code associated with it. If a trigger start getting overly large, then call a stored procedure from the trigger.
 
I'm creating a "TreeView" like ASP page, which shows the hierarchy of a company. I uses a Oracle 8 DB.
I need to count to control the number of employees below someone so I show the "T" connector (not last employee) or the "L" connector (last employee).
I already have this ASP page working, but the connection with the Oracle is very slow, because the counts (which it is done by 2 views), is slowing down the connection.
If someone have a good solution, please help me.

Thank you

NiteCrawlr

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top