Registers the return type of the specified foreign function.
PROCEDURE Ora_Ffi.Register_Return
(funcHandle funcHandleType,
creturntype PLS_INTEGER);
PROCEDURE Ora_Ffi.Register_Return
(funcHandle funcHandleType,
creturntype PLS_INTEGER,
plsreturntype PLS_INTEGER);
Parameter | Description |
---|---|
funcHandle | A function handle returned by Ora_Ffi.Register_Function or Ora_Ffi.Find_Function. |
creturntype |
The C datatype returned by the foreign function. The value of this argument may be one of the following packaged constants: C_CHAR means char |
plsreturntype |
The corresponding PL/SQL return type (optional). |
A handle to the foreign function.
/* 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.funcHandleType;
BEGIN
/* Register the info for function getresult */
getresult_fhandle := ora_ffi.register_function
(testlib_lhandle,'getresult');
/* Register the return type for function getresult */
ora_ffi.register_return
(getresult_fhandle, ora_ffi.C_CHAR_PTR);
/* 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);
...
/* Generate PL/SQL package containing all
functions defined in test library */
ora_ffi.generate_foreign
(testlib_lhandle, 'test_ffi_pkg');
...
END;