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

ORA_FFI.REGISTER_FUNCTION built-in function

This function registers a specified foreign function.

Syntax


FUNCTION ORA_FFI.REGISTER_FUNCTION
libhandle libHandleType,
funcname VARCHAR2,
callstd NUMBER := C_STD)
RETURN funcHandleType;

Parameters

Parameter

Description

libhandle

A library handle returned by ORA_FFI.LOAD_LIBRARY or ORA_FFI.FIND_LIBRARY.

funcname

The name of the function to be registered.

callstd

The calling used by the foreign function. (For more information, refer to your compiler documentation.) The value of this argument may be one of the following packaged constants:

  • C_STD Means the foreign function uses the C calling standard.
  • PASCAL_STD Means the foreign function uses the Pascal calling standard.
  •  

    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'); 
      
      ...
      
      /* Generate PL/SQL package containing all
      functions defined in test library */
      ORA_FFI.GENERATE.FOREIGN
      (testlib_lhandle, 'test_ffi_pkg');
      ... 
    END;
    

    See also

    About the ORA_FFI built-in package

    ORA_FFI built-in package