Fórum DLL em Oracle #325102
10/07/2006
0
Olá pessoal
preciso criar uma DLL (library) no oracle, mas a DLL está escrita em Delphi. É possível fazer isto, ou só são suportadas linguagens derivadas de C?
fiz alguns testes, porém no momento que executo a procedure/function, me retorna a mensagem:
´ERRO na linha 1:
ORA-06520: PL/SQL: Erro ao carregar biblioteca externa
ORA-06522: Unable to load DLL
ORA-06512: em ´SPMAIOLA.PKGDLL´, line 2
ORA-06512: em ´SPMAIOLA.R088AUT_EU´, line 2
ORA-04088: erro durante a execução do gatilho ´SPMAIOLA.R088AUT_EU´´
aqui está o fonte do teste que fiz:
//DLL
library G5_e_G6;
uses
JNI, dialogs, SysUtils;
function Teste(pTeste: string): string; {$IFDEF WIN32} stdcall; {$ENDIF} {$IFDEF LINUX} cdecl; {$ENDIF}
begin
// Create a new string and return it
result := pTeste;
end;
exports
Teste;
end.
// criação da library no banco
create or replace library dll as ´C:\G5_e_G6.dll´;
/
// package
create or replace package pkgdll as function Teste(param_in varchar2)
return varchar2;
pragma restrict_references(Teste, WNDS);
end pkgdll;
/
// package body
create or replace package body pkgdll as function Teste(param_in varchar2)
return varchar2
is external name ´Teste´
library dll parameters(param_in string, return string);
end pkgdll;
/
// chamada em uma trigger after update
create or replace TRIGGER R088AUT_EU AFTER UPDATE ON R088AUT FOR EACH ROW
begin
RAISE_APPLICATION_ERROR(-20000 + -(103), pkgdll.Teste(´olá´));
end;
/
// update
UPDATE R088AUT SET CADAUT = 4 WHERE CADCON = 4;
dando o update, aparece a mensagem de erro.
valeu pessoal!
[]´s :D
preciso criar uma DLL (library) no oracle, mas a DLL está escrita em Delphi. É possível fazer isto, ou só são suportadas linguagens derivadas de C?
fiz alguns testes, porém no momento que executo a procedure/function, me retorna a mensagem:
´ERRO na linha 1:
ORA-06520: PL/SQL: Erro ao carregar biblioteca externa
ORA-06522: Unable to load DLL
ORA-06512: em ´SPMAIOLA.PKGDLL´, line 2
ORA-06512: em ´SPMAIOLA.R088AUT_EU´, line 2
ORA-04088: erro durante a execução do gatilho ´SPMAIOLA.R088AUT_EU´´
aqui está o fonte do teste que fiz:
//DLL
library G5_e_G6;
uses
JNI, dialogs, SysUtils;
function Teste(pTeste: string): string; {$IFDEF WIN32} stdcall; {$ENDIF} {$IFDEF LINUX} cdecl; {$ENDIF}
begin
// Create a new string and return it
result := pTeste;
end;
exports
Teste;
end.
// criação da library no banco
create or replace library dll as ´C:\G5_e_G6.dll´;
/
// package
create or replace package pkgdll as function Teste(param_in varchar2)
return varchar2;
pragma restrict_references(Teste, WNDS);
end pkgdll;
/
// package body
create or replace package body pkgdll as function Teste(param_in varchar2)
return varchar2
is external name ´Teste´
library dll parameters(param_in string, return string);
end pkgdll;
/
// chamada em uma trigger after update
create or replace TRIGGER R088AUT_EU AFTER UPDATE ON R088AUT FOR EACH ROW
begin
RAISE_APPLICATION_ERROR(-20000 + -(103), pkgdll.Teste(´olá´));
end;
/
// update
UPDATE R088AUT SET CADAUT = 4 WHERE CADCON = 4;
dando o update, aparece a mensagem de erro.
valeu pessoal!
[]´s :D
Ricardomaiola
Curtir tópico
+ 0
Responder
Posts
11/07/2006
Motta
Até a versão 9 do Oracle só suprotava dll´s feitas em C, não sei se mudou, não sei se existe porém alguma diretiva no Delphi que permita uma emulação de C.
Responder
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)