Home » Developer & Programmer » Precompilers, OCI & OCCI » sample code needed: external C representation of a user def. obj-type
sample code needed: external C representation of a user def. obj-type [message #94001] Fri, 01 August 2003 04:52
Henrik Kuhn
Messages: 2
Registered: August 2003
Junior Member
Hi all,

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

Do I need a PL/SQL- to C type translation? How is this done?

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: exception ORA-32101 when creating environment
Next Topic: looking for sample code of an object-type's CTOR in C
Goto Forum:
  


Current Time: Sun Nov 24 14:46:25 CST 2024