Hi
I am looking to use OCL to make it easier for me to write external procedures for Oracle. I have looked at the extproc example and it uses simple types such as int and char*. I am wondering if I have a procedure taking BLOB types, if it is possible to convert the OCILOBLOCATOR* that Oracle will pass into my function, into CRLob objects?
e.g.
extern "C" int __declspec(dllexport)
externalProcedure(OCIExtProcContext* context, OCILOBLOCATOR* x, char* y)
{
CRLob x_lob( x ); // how to write this line?
}
BLOB in OCL external procedure
OCL does not have exact constructor that you need.
Please use OCIExtProcGetEnv function for receiving OCISvcCtx from given OCIExtProcContext.
Then you have to pass OCILOBLOCATOR* and OCISvcCtx to hOCILobLocator and hOCISvcCtx fields of OraLob.
Please use OCIExtProcGetEnv function for receiving OCISvcCtx from given OCIExtProcContext.
Code: Select all
sword OCIExtProcGetEnv ( OCIExtProcContext *with_context,
OCIEnv envh,
OCISvcCtx svch,
OCIError errh );
Code: Select all
class OraLob : public CRLob {
...
protected:
OCILobLocator* hOCILobLocator;
OCISvcCtx* hOCISvcCtx;
...
}