Home » Developer & Programmer » Precompilers, OCI & OCCI » looking for sample code of an object-type's CTOR in C
looking for sample code of an object-type's CTOR in C [message #94003] Sat, 02 August 2003 13:45
Henrik Kuhn
Messages: 2
Registered: August 2003
Junior Member
Hi all,

can someone provide C sample code or framework for working
with a user defined object type representation in an external C
procedure, especially regarding constructors and how to return
'SELF' as shown in the PL/SQL-code below.

So far I couldn't find any examples in the docs.

Thanks,
Henrik

CREATE OR REPLACE TYPE my_obj
AS OBJECT
(
juice BLOB

, CONSTRUCTOR FUNCTION my_obj
(
data IN CLOB
, fmt IN PLS_INTEGER
)
RETURN SELF AS RESULT

, MEMBER FUNCTION GetFoo
RETURN VARCHAR2
)

CREATE OR REPLACE TYPE BODY my_obj
AS
CONSTRUCTOR FUNCTION my_obj
(
data IN CLOB
, fmt IN PLS_INTEGER
)
RETURN SELF AS RESULT
AS LANGUAGE C
NAME "ctor_my_obj"
LIBRARY my_lib
WITH CONTEXT
PARAMETERS
(
CONTEXT
, data OCILOBLOCATOR
, data INDICATOR
, fmt UNSIGNED INT
, fmt INDICATOR
, RETURN SELF
, RETURN SELF INDICATOR STRUCT
);

MEMBER FUNCTION GetFoo
RETURN VARCHAR2
AS LANGUAGE C
NAME "get_foo"
LIBRARY my_lib
WITH CONTEXT
PARAMETERS
(
CONTEXT
, SELF
, SELF INDICATOR STRUCT
, RETURN STRING
, RETURN INDICATOR
);

END;
Previous Topic: sample code needed: external C representation of a user def. obj-type
Next Topic: libsocket
Goto Forum:
  


Current Time: Sun Nov 24 14:35:22 CST 2024