Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

I am trying to invoke .dll(C#) windows application from oracle 10g using trigger

6d44345a-4de9-4313-8876-782eab0d539cDec 19 2014 — edited Apr 2 2015

Hi,

I am trying to invoke .dll from oracle 10g using trigger

first i created  dll_test_func1  package as follows

Spec:

CREATE OR REPLACE PACKAGE dll_test_func1 AS FUNCTION FETCHID(ID in pls_integer)

RETURN PLS_INTEGER;

END dll_test_func1;

/

Body:

CREATE OR REPLACE PACKAGE body dll_test_func1 AS

FUNCTION FETCHID (ID in pls_integer)

RETURN PLS_INTEGER IS EXTERNAL LIBRARY dll_test

NAME "FEATCHDLL" -- name of function in kernel32.dll

LANGUAGE C -- external routine is written in C

CALLING STANDARD PASCAL

PARAMETERS -- map PL/SQL to C parameters by position

( ID BY REFERENCE int, RETURN int);

END dll_test_func1;

/

dll_test  this is library i am created

CREATE OR REPLACE LIBRARY dll_test AS C:\CustomerSquareV3\CustomerSquareV3.dll' ;

and i also published my C#.net application .dll in same path

Following is the trigger that i created

CREATE OR REPLACE TRIGGER MNGH.CSQ7

AFTER INSERT

ON MNGH.INVDISMAIN   ------------ table name

REFERENCING NEW AS NEW OLD AS OLD

FOR EACH ROW

declare

ID number;

BEGIN

select dll_test_func1.FETCHID(:new.discode) into ID from dual;

  INSERT INTO TEMP_TABLE (NAME) values (ID);    

  

END;

when we are trying to make a bill in XYZ POS or manually in the database  table i.e INVDISMAIN one row has to be inserted

but it is throwing an error and hence the values are not getting inserted.

ERRORS:

#18-DEC-2014 15:26:32#       Application error : FRM-40508: ORACLE error: unable to INSERT record.

#18-DEC-2014 15:26:32#       Database error : -6521: ORA-06521: PL/SQL: Error mapping function

ORA-06522: Unable to load symbol from DLL

ORA-06512: at "MNGH.CSQ7", line 4

ORA-04088: error during execution of trigger 'MNGH.CSQ7'

please help me out on this its very urgent.

Regards

----------

PraveenKumar

9886558537

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 30 2015
Added on Dec 19 2014
4 comments
1,492 views