A script-enabled browser is required for this page to function properly.

ORA_FFI.Register_Parameter

Description

Registers the argument type of the current argument of the specified foreign function.

Syntax


PROCEDURE Ora_Ffi.Register_Parameter
   (funcHandle funcHandleType,
    cargtype   PLS_INTEGER);

PROCEDURE Ora_Ffi.Register_Parameter
   (funcHandle funcHandleType,
    cargtype   PLS_INTEGER,
    plsargtype PLS_INTEGER);

Parameters

Parameter Description
funcHandle A function handle returned by Ora_Ffi.Register_Function or Ora_Ffi.Find_Function.
funcname

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 *

plsargtype

The corresponding PL/SQL argument type (optional).

Returns

A handle to the foreign function.

Example


 /* 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 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;