Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Using LONG RAW in a external Procedure

Using LONG RAW in a external Procedure

From: Andrew Tacchi <andrew.tacchi_at_capgemini.co.uk>
Date: Wed, 2 Jun 1999 10:39:51 +0100
Message-ID: <7j2u5a$rr2$1@taliesin.netcom.net.uk>


Hi,

I am trying to pass a long raw into a external procedure made in C. It seems to work for small values put for larger values the extproc Dr Watsons.

I am using oracle 8i on NT + SP3.

The simple C code is meant to just save the long raw onto the file system.

DllExport int WriteRawFile( char * fileName, unsigned char * file, int * file_len )
{
 ofstream tfile( fileName , ios::binary );  tfile.write( file, *file_len );
 tfile.close();
 return *file_len;
}

The PLSQL function is defined as follows

CREATE OR REPLACE FUNCTION WRITERAWFILE ( filename IN VARCHAR2,
  file IN LONG RAW )
RETURN BINARY_INTEGER AS EXTERNAL
 LIBRARY pldll
 NAME "WriteRawFile"
 LANGUAGE C
 CALLING STANDARD PASCAL
 PARAMETERS (
   filename,
   file,
   file LENGTH );

My guess is that it only really works for RAW and not LONG RAW.

Any pointers will be greatly appricated

Cheers

Andrew Tacchi Received on Wed Jun 02 1999 - 04:39:51 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US