PHP equivalent for Oracle ORA_FFI

From: Date: Fri, 22 Jun 2001 08:28:15 +0000
Subject: PHP equivalent for Oracle ORA_FFI
Groups: php.general 
Request: Send a blank email to php-general+get-54849@lists.php.net to get a copy of this message
We have a data load program written in Oracle Reports 2.5 (yes, I know, it wasn't me!). This uses ORA_FFI to interface with a .dll to validate and reformat addresses. I would like to perform the same interface in PHP if possible, without needing to do any development work on or around the .dll. Can anyone point me in the right direction? Some sample code below. The key points are, I think. 1. Oracle seems to be able, using Ora_FFI, to directly access a function in a .dll, passing it parameters, and receiving its return output. 2. In the package initialization, at the end of the page, the .dll 'TBIF100.dll', referrred to as a library, is first loaded and opened, and then the function 'PAS988V659' within the library is registered along with its in/out parameters. 3. As a result of this, the dll and the function are assigned handles. The function handle is used in the function i_obm988 to actually execute the function.It's a rather strange looking bit of PL/SQL but it works! PACKAGE BODY call_cbm988_pas IS lh_obm988 ora_ffi.libHandleType; fh_obm988 ora_ffi.funcHandleType; FUNCTION i_obm988( funcHandle IN ora_ffi.funcHandleType ,cons_name IN OUT VARCHAR2 -- other parameters ) RETURN PLS_INTEGER; PRAGMA INTERFACE(C,i_obm988,11265); BEGIN -- Package Initialization BEGIN lh_obm988 := ora_ffi.find_library('TBIF100.dll'); EXCEPTION WHEN ora_ffi.FFI_ERROR THEN lh_obm988 := ora_ffi.load_library(NULL,'TBIF100.dll'); END ; fh_obm988 := ora_ffi.register_function(lh_obm988,'PAS988V659',ora_ffi.PASCAL_STD); ora_ffi.register_parameter(fh_obm988,ORA_FFI.C_CHAR_PTR); ora_ffi.register_parameter(fh_obm988,ORA_FFI.C_CHAR_PTR); -- register other parameters END call_cbm988_pas; Thanks Euan

« previous php.general (#54849) next »