-
How to net send from Oracle db?
I have a requirement whereby I need to have a net send message sent to a particular terminal when a specific value is inserted in a table.
A rough example would be say you have a table that tracks order and one of the columns is quantity. Since some items are frequently out of stock, you want to be notified any time a record is inserted into this table with more than quantity 'x'. I can see creating a trigger to check for this condition, but I am lost from there.
What I would like to do is say an order is inserted for 100 items, and I want my trigger to fire for any record where a quantity is greater than 50, so I create a trigger to call something (package,procedure,external prog?) to perform my net send. The purpose of this whole exercise would be to alert me that a "large" order (humor me here) has been placed.
My question is this: is there some facility in Oracle that would allow me to do this without extensive coding? I can create a simple SQL that has a host command in it that does the net send, and that is accomplished easily enough, but my quandry is how to I get the trigger to run the SQL file? If anyone has a link or some sample code to do this it would be greatly appreciated!
BTW, the db will be Oracle 8.1.7, and the OS will be Win2k or NT.
Thx,
Ray
-
Why settle for net send when you can have Oracle send you email or send a page?
-
And it's easier to send email from trigger than to net send from trigger.
Tomaž
"A common mistake that people make when trying to design something completely
foolproof is to underestimate the ingenuity of complete fools" - Douglas Adams
-
Other things you might want to look at are DBMS_PIPE and DBMS_ALERT. Alert is a multicast and requires that the target client is connected. Pipe is one-to-one and doesn't.
There are also differences with transactions. You can read all about it in the docs.
I've successfully used both on the same environment as yourself.
-
Net Send vs Email
The only issue of sending an email (which I admit would be easier since Oracle has a facility for this) is that none of the machines that need to get the message are running an email client. These client machines are locked down by administrators and users only have access to the application they are to be working with on their computers, so no email, no web access, not even Office apps. Net send is not a requirement, I just need a method to alert them when another user inputs a certain value in a column, just an electronic 'FYI' if you will. I'm sure I could do this in C+, but I was looking for the easy way out...
-
SQL> host net send name_of_your_pc hello
try it
You can have a trigger do this
-
Originally posted by stecal
SQL> host net send name_of_your_pc hello
try it
You can have a trigger do this
You crazy man.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|