ORA_FFI.REGISTER_PARAMETER
built-in procedureThis procedure registers the argument type of the current argument of the specified foreign function.
PROCEDURE ORA_FFI.REGISTER_PARAMETER
(funchandle funcHandleType,
cargtype PLS_INTEGER);
PROCEDURE ORA_FFI.REGISTER_PARAMETER
(funchandle funcHandleType,
cargtype PLS_INTEGER,
plsargtype PLS_INTEGER);
Parameter |
Description |
|
A function handle returned by |
|
The C datatype of the current argument to the C foreign function being called. The value of this argument may be one of the following packaged constants: C_CHAR means char C_CHAR_PTR means char * C_DOUBLE means double C_DOUBLE_PTR means double * C_FLOAT means float C_FLOAT_PTR means float * C_INT means int C_INT_PTR means int * C_LONG means long C_LONG_PTR means long * C_SHORT means short C_SHORT_PTR means short * C_VOID_PTR means void * |
|
The corresponding PL/SQL argument type (optional). |
/* Define Procedure define_c_funcs which calls two
ORA_FFI functions, getresult and foo. */
PROCEDURE define_c_funcs is
getresult_fhandle ORA_FFI.FUNCHANDLETYPE;
foo_fhandle ORA_FFI.FUNCHANDLETYPEe;
BEGIN
/* Register the info for function getresult */
getresult_fhandle := ORA_FFI.REGISTER_FUNCTION
(testlib_lhandle,'getresult');
...
/* Register the info for function foo */
foo_fhandle := ORA_FFI.REGISTER_FUNCTION
(testlib_lhandle,'foo');
/* Register the return type for function foo */
ORA_FFI.REGISTER_RETURN
(foo_fhandle, ORA_FFI.C_SHORT);
/* Register the parameter info for function foo */
ORA_FFI.REGISTER_PARAMETER
(foo_fhandle, ORA_FFI.C_FLOAT);
ORA_FFI.REGISTER_PARAMETER
(foo_fhandle, ORA_FFI.C_INT);
ORA_FFI.REGISTER_PARAMETER
(foo_fhandle, ORA_FFI.C_CHAR_PTR);
/* Generate PL/SQL package containing all functions
defined in test library */
ORA_FFI.GENERATE.FOREIGN
(testlib_lhandle, 'test_ffi_pkg');
...
END;
About the ORA_FFI
built-in package
Copyright © 1984, 2005, Oracle. All rights reserved.