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;
|
|
|