Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> resending: Database triggers and Stored Precedure related
Hi,
Resending with the hope that someone would have an answer :)
Can someone pls help us with the following problem?
Any help would be appreciated.
regards
harsh
Requirement:
Whenever a row is deleted from a database table, the client application shall get the deletion details.
Description of the Table naren_subscribers.
Name Null? Type ----------------------------------------- -------- ---------------------------- USERID NOT NULL NUMBER(38) SUBSCRIBER VARCHAR2(30) HOST NOT NULL VARCHAR2(100) ALIAS VARCHAR2(30) AUTHFAILURE NUMBER(38) BLOCKSTATUS NUMBER(38)
The trigger is defined as follows
CREATE OR REPLACE TRIGGER Pre_del_trigger
BEFORE DELETE ON naren_subscribers
FOR EACH ROW
declare
return_value double precision;
Begin
return_value := senddata(:old.userid, :old.authfailure);
end;
/
The function is defined as follows
SQL> CREATE OR REPLACE FUNCTION senddata (
arg1 IN NUMBER,
arg2 IN NUMBER )
return DOUBLE PRECISION AS
EXTERNAL NAME "senddata"
LIBRARY libsenddata
LANGUAGE C;
/
The C procedure is as follows
double senddata (OCINumber USER_ID, OCINumber AUTHFAILURE ) {
/* This c procedure opens a socket connection to client application
(which needs the information of the deleted row.) and passes this USER_ID
and AUTHFAILURE */.
}
This C procedure is compiled and senddata.so is generated. This .so is placed in oracle server by creating a library libsenddata. All OCI related headers are included in C procedure
Assumptions:
The function senddata that is defined above is sending arguments as NUMBER. So the equivalent datatype in C is OCINumber.
The problem description:
This message is proprietary to Hughes Software Systems Limited (HSS) and is intended solely for the use of the individual to whom it is addressed. It may contain privileged or confidential information and should not be circulated or used for any purpose other than for what it is intended. If you have received this message in error, please notify the originator immediately. If you are not the intended recipient, you are notified that you are strictly prohibited from using, copying, altering, or disclosing the contents of this message. HSS accepts no responsibility for loss or damage arising from the use of the information transmitted by this email including damage from virus.
-- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: INET: hbhondwe_at_hss.hns.com Fat City Network Services -- 858-538-5051 http://www.fatcity.com San Diego, California -- Mailing list and web hosting services --------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-LReceived on Thu Oct 17 2002 - 09:54:08 CDT
(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing).
![]() |
![]() |