dbaspot
Tags Register FAQ Calendar Search Today's Posts Mark Forums Read

using object types in pro*c/c++ - Oracle

This is a discussion on using object types in pro*c/c++ - Oracle ; HI all, I am trying to use oracle object types in pro*c/c++ program. Below are the detailes. objects being used OBJ_BACKGROUND_JOB , OBJ_BACKGROUND_JOB_ARRAY. ott infile : inpfile CASE=SAME TYPE OBJ_BACKGROUND_JOB TYPE OBJ_BACKGROUND_JOB_ARRAY ott command : ott userid=scott/tiger code=C intype=inpfile outtype=ottouttype ...


Home > Database Forum > Oracle Database > Oracle > using object types in pro*c/c++

Reply

 

LinkBack Thread Tools Display Modes
  #1  
Old 09-24-2009, 08:12 AM
Database Newbie
 
Join Date: Sep 2009
Posts: 2
hysat429 is on a distinguished road
Post using object types in pro*c/c++

HI all,

I am trying to use oracle object types in pro*c/c++ program. Below are the detailes.

objects being used OBJ_BACKGROUND_JOB , OBJ_BACKGROUND_JOB_ARRAY.

ott infile : inpfile
CASE=SAME
TYPE OBJ_BACKGROUND_JOB
TYPE OBJ_BACKGROUND_JOB_ARRAY

ott command : ott userid=scott/tiger code=C intype=inpfile outtype=ottouttype hfile=obj_background_job_array.h

the command generated the header file and an outtype file
obj_background_job_array.h :
#ifndef OBJ_BACKGROUND_JOB_ARRAY_ORACLE
# define OBJ_BACKGROUND_JOB_ARRAY_ORACLE

#ifndef OCI_ORACLE
# include
#endif

typedef OCIRef OBJ_BACKGROUND_JOB_ref;
typedef OCITable OBJ_BACKGROUND_JOB_ARRAY;

struct OBJ_BACKGROUND_JOB
{
OCINumber SNO;
OCIString * PARAMETER;
};
typedef struct OBJ_BACKGROUND_JOB OBJ_BACKGROUND_JOB;

struct OBJ_BACKGROUND_JOB_ind
{
OCIInd _atomic;
OCIInd SNO;
OCIInd PARAMETER;
};
typedef struct OBJ_BACKGROUND_JOB_ind OBJ_BACKGROUND_JOB_ind;

ott outtype file : ottouttype.typ
CASE = SAME

TYPE OBJ_BACKGROUND_JOB AS OBJ_BACKGROUND_JOB
VERSION = "$8.0"
HFILE = obj_background_job_array.h

TYPE OBJ_BACKGROUND_JOB_ARRAY AS OBJ_BACKGROUND_JOB_ARRAY
VERSION = "$8.0"
HFILE = obj_background_job_array.h

below is the proc code in which I am using the above defined types : types.pc
#include
#include
#include
#include
#include
#include
#include "obj_background_job_array.h"
#define SQLCA_STORAGE_CLASS extern
int main()
{

EXEC SQL BEGIN DECLARE SECTION ;
OCIString * abcd ;
OBJ_BACKGROUND_JOB * obj_background_job ;
OBJ_BACKGROUND_JOB_ind * obj_background_job_ind ;
OCIString * abc ;
EXEC SQL END DECLARE SECTION ;

EXEC SQL ALLOCATE :abc;
EXEC SQL ALLOCATE :abcd;
EXEC SQL ALLOCATE bj_background_jobbj_background_job_ind ;
.
.
.
return 0 ;

}

When i compile the above code using the command proc types config=pcscfg.cfg i get the below error
Syntax error at line 24, column 9, file types.pc:
Error at line 24, column 9 in file types.pc
OBJ_BACKGROUND_JOB * obj_background_job ;
........1
PCC-S-02201, Encountered the symbol "OBJ_BACKGROUND_JOB" when expecting one of t
he following:

auto, char, const, double, enum, extern, float, int, long,
ulong_varchar, OCIBFileLocator OCIBlobLocator,
OCIClobLocator, OCIDateTime, OCIExtProcContext, OCIInterval,
OCIRowid, OCIDate, OCINumber, OCIRaw, OCIString, register,
short, signed, sql_context, sql_cursor, static, struct,
typedef, union, unsigned, utext, uvarchar, varchar, void,
volatile, a typedef name, a precompiled header, exec oracle,
exec oracle begin, exec, exec sql, exec sql begin,
exec sql end, exec sql type, exec sql var, exec sql include,
The symbol "enum," was substituted for "OBJ_BACKGROUND_JOB" to continue.

Syntax error at line 25, column 9, file types.pc:
Error at line 25, column 9 in file types.pc
OBJ_BACKGROUND_JOB_ind * obj_background_job_ind ;
........1
PCC-S-02201, Encountered the symbol "OBJ_BACKGROUND_JOB_ind" when expecting one
of the following:

auto, char, const, double, enum, extern, float, int, long,
ulong_varchar, OCIBFileLocator OCIBlobLocator,
OCIClobLocator, OCIDateTime, OCIExtProcContext, OCIInterval,
OCIRowid, OCIDate, OCINumber, OCIRaw, OCIString, register,
short, signed, sql_context, sql_cursor, static, struct,
typedef, union, unsigned, utext, uvarchar, varchar, void,
volatile, a typedef name, a precompiled header, exec oracle,
exec oracle begin, exec, exec sql, exec sql begin,
exec sql end, exec sql type, exec sql var, exec sql include,
The symbol "enum," was substituted for "OBJ_BACKGROUND_JOB_ind" to continue.
Error at line 0, column 0 in file types.pc
PCC-F-02102, Fatal error while doing C preprocessing



contents of pcscfg.cfg is :
USERID=scott/tiger
code=cpp
parse=none
define=DM_PAGE_SIZE
release_cursor=yes
sqlcheck=semantics
INTYPE=ottouttype.typ
OBJECTS=YES
sys_include=(/apps/util/oracle/product/11.1.0-64bit/precomp/public,/opt/SUNWspro6u1/WS6U1/include/CC4,/usr/include)
ltype=short
MODE=ORACLE


Please suggest on how to resolve the problem ... Thanks in advance for your help.
Reply With Quote
  #2  
Old 10-12-2009, 04:50 AM
Database Newbie
 
Join Date: Oct 2009
Posts: 2
shane o corner is on a distinguished road
Default Re: using object types in pro*c/c++

the problem occurred here i think is due to accessing the private member function. so i would suggest you to first indicate the member function as public and then try to access to it..or else u can log on to www.learn-Oracle-OLAP.com for further queries
Reply With Quote
Reply

Tags
object types, oracle types, pro*c, pro*c/c++, proc

Thread Tools
Display Modes


Similar Threads

Thread Thread Starter Forum Replies Last Post
SQL 2008 AS, RS, and SSIS fail on OWC11 Database Administrator sqlserver-faq 1 08-14-2008 10:28 PM
Re: CHECKTABLE give error Msg 8929, Level 16, State 1, Line 1 how to no which row is effected Database Administrator sqlserver-server 0 05-01-2008 09:53 AM
CHECKTABLE give error Msg 8929, Level 16, State 1, Line 1 how to no which row is effected Database Administrator sqlserver-server 0 05-01-2008 09:31 AM
WCS-36422: The node types array object could not be stored in cache. domregchief Oracle APP Server 0 03-14-2008 05:44 AM
How is possible that avg_data_blocks_per_key = 0 even with freshstatistics ? Database Administrator Oracle Server 34 12-14-2007 09:54 AM


All times are GMT -4. The time now is 11:46 AM.