Hello,
I'm attempting to use Pro*C to create a nested table and send that data
to a stored procedure as a parameter. However, I'm getting a Pro*C compiler
error that I'll describe below. I'm using Oracle 10.2 on Unix.
1. First I created a nested table type in the database:
CREATE TYPE varchar2_list AS TABLE OF VARCHAR2(15);
2. Then I created the input file for "ott", called "acttest.typ":
CASE=LOWER
TYPE activity.varchar2_list
3. Next I used "ott" to generate the header file needed in my .pc file:
ott userid=[user]/[pass]@[tns_name] intype=acttest.typ outtype=out.typ code=c hfile=acttype.h
This command was successful.
4. Then I attempted to declare a variable of type "varchar2_list" in my source file, "acttest.pc":
#include <sqlca.h>
#include "acttype.h"
...
EXEC SQL BEGIN DECLARE SECTION;
...
varchar2_list *vclProductCodeList;
...
EXEC SQL END DECLARE SECTION;
When I compile with "proc", I get the following compiler error:
Syntax error at line 894, column 7, file acttest.pc:
Error at line 894, column 7 in file acttest.pc
varchar2_list *vclProductCodeList;
......1
PCC-S-02201, Encountered the symbol "varchar2_list" when expecting one of the fo
llowing:
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 "varchar2_list" to continue.
Why can't Pro*C recognize my new "varchar2_list" type? Does it matter if the DB user used in the Pro*C application doesn't own the nested table object? I have included my command line:
proc code=cpp sys_include='(/opt/SUNWspro/prod/include/CC,/opt/SUNWspro/prod/include/CC4,/usr/include,/u01/app/oracle/product/10.2.0/rdbms/public,.)' sqlcheck=semantics userid=[user]/[password]@[tns] include='(/u01/app/oracle/product/10.2.0/rdbms/public,.)' intype=out.typ acttest.pc
Thanks in advance for any helpful information.