ORA_FFI Errors
IQMay 17 2011 — edited May 18 2011Hi everyone,
I am trying to create this package body but I get the following errors , What could be wrong ? How do I get rid of these errors ? I am using Oracle 10G.
Thanks
fm
[Error] PLS-00201 (3: 14): PLS-00201: identifier 'ORA_FFI.LIBHANDLETYPE' must be declared,
[Error] PLS-00201 (4: 18): PLS-00201: identifier 'ORA_FFI.FUNCHANDLETYPE' must be declared,
[Error] PLS-00201 (8: 40): PLS-00201: identifier 'ORA_FFI.FUNCHANDLETYPE' must be declared,
[Error] PLS-00320 (47: 28): PLS-00320: the declaration of the type of this expression is incomplete or malformed,
[Error] PLS-00201 (58: 3): PLS-00201: identifier 'MESSAGE' must be declared,
[Error] PLS-00320 (63: 6): PLS-00320: the declaration of the type of this expression is incomplete or malformed,
[Error] PLS-00201 (64: 21): PLS-00201: identifier 'ORA_FFI.FFI_ERROR' must be declared,
[Error] PLS-00320 (69: 6): PLS-00320: the declaration of the type of this expression is incomplete or malformed,
[Error] PLS-00201 (70: 21): PLS-00201: identifier 'ORA_FFI.FFI_ERROR' must be declared,
[Error] PLS-00320 (73: 6): PLS-00320: the declaration of the type of this expression is incomplete or malformed
create or replace
PACKAGE BODY Crystal AS
lh_crpe ora_ffi.libHandleType;
fh_PEPrintReport ora_ffi.funcHandleType;
FUNCTION i_PEPrintReport(funcHandle IN ora_ffi.funcHandleType
,reportFilePath IN OUT VARCHAR2,
toDefaultPrinter IN PLS_INTEGER,
toWindow IN PLS_INTEGER,
title IN OUT VARCHAR2,
left IN PLS_INTEGER,
top IN PLS_INTEGER,
width IN PLS_INTEGER,
height IN PLS_INTEGER,
style IN PLS_INTEGER,
parentWindow IN PLS_INTEGER)
RETURN PLS_INTEGER;
PRAGMA INTERFACE(C,i_PEPrintReport,11265);
FUNCTION PEPrintReport
(reportFilePath IN OUT VARCHAR2,
toDefaultPrinter IN PLS_INTEGER,
toWindow IN PLS_INTEGER,
title IN OUT VARCHAR2,
left IN PLS_INTEGER,
top IN PLS_INTEGER,
width IN PLS_INTEGER,
height IN PLS_INTEGER,
style IN PLS_INTEGER,
parentWindow IN PLS_INTEGER)
RETURN PLS_INTEGER IS
reportFilePath_l VARCHAR2(512) := reportFilePath;
toDefaultPrinter_l PLS_INTEGER := toDefaultPrinter;
toWindow_l PLS_INTEGER := toWindow;
title_l VARCHAR2(512) := title;
left_l PLS_INTEGER := left;
top_l PLS_INTEGER := top;
width_l PLS_INTEGER := width;
height_l PLS_INTEGER := height;
style_l PLS_INTEGER := style;
parentWindow_l PLS_INTEGER := parentWindow;
rc PLS_INTEGER;
BEGIN
init;
rc := i_PEPrintReport(fh_PEPrintReport
,reportFilePath_l,
toDefaultPrinter_l,
toWindow_l,
title_l,
left_l,
top_l,
width_l,
height_l,
style_l,
parentWindow_l);
message('rc'||to_char(rc));
RETURN (rc);
END ;
procedure init is
BEGIN
lh_crpe := ora_ffi.find_library('c:\windows\system\crpe32.dll');
EXCEPTION WHEN ora_ffi.FFI_ERROR THEN
lh_crpe := ora_ffi.load_library(NULL,'c:\windows\system\crpe32.dll');
END init;
BEGIN
begin
lh_crpe := ora_ffi.find_library('c:\windows\system\crpe32.dll');
EXCEPTION WHEN ora_ffi.FFI_ERROR THEN
lh_crpe := ora_ffi.load_library(NULL,'c:\windows\system\crpe32.dll');
END ;
fh_PEPrintReport := ora_ffi.register_function(lh_crpe,'PEPrintReport',ora_ffi.PASCAL_STD);
ora_ffi.register_parameter(fh_PEPrintReport,ORA_FFI.C_CHAR_PTR);
ora_ffi.register_parameter(fh_PEPrintReport,ORA_FFI.C_INT);
ora_ffi.register_parameter(fh_PEPrintReport,ORA_FFI.C_INT);
ora_ffi.register_parameter(fh_PEPrintReport,ORA_FFI.C_CHAR_PTR);
ora_ffi.register_parameter(fh_PEPrintReport,ORA_FFI.C_SHORT);
ora_ffi.register_parameter(fh_PEPrintReport,ORA_FFI.C_SHORT);
ora_ffi.register_parameter(fh_PEPrintReport,ORA_FFI.C_SHORT);
ora_ffi.register_parameter(fh_PEPrintReport,ORA_FFI.C_SHORT);
ora_ffi.register_parameter(fh_PEPrintReport,ORA_FFI.C_LONG);
ora_ffi.register_parameter(fh_PEPrintReport,ORA_FFI.C_INT);
ora_ffi.register_return(fh_PEPrintReport,ORA_FFI.C_INT);
END Crystal ;