Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> BIZARRE problem with OCI array bind, insert
Here is one for the OCI experts out there ... (sorry it is a bit long)
Platform:
Oracle 8i 8.1.5 on Sun Sparc Solaris 7
Background:
I have written a simple database conversion utility that connects to
both Sybase and Oracle, reads the Sybase system tables to get the schema
info, creates the equivalent schema in an empty Oracle database, and
then copies all the data over. The data copy part copies a large number
of rows at a time by using a bulk bind for Sybase, storing the data in
arrays, and then uses an array bind in the OCI to transfer the data in
those arrays to Oracle. The Sybase database being copied has around 430
tables and is about 250 Megs in size.
The Problem:
For only ONE table, I am getting an "Invalid Column Name" error during
the data copy part of the operation. The schema creation part of my
utility works fine - no complaints when creating the table, so
presumeably I am not using a reserved word for the table name or any
column names. Only when I issue the insert statement with column
placeholders do I get the error. The exact same code is running to do
this table as for others, so I know that the generation of the statement
works. If I use sqlplus, I can do a desc of the table and it works.
Also with sqlplus, I can manually insert a row into the table
(specifying a column list and values list the same way as my program
does except with real values instead of placeholders) and then query the
table and there is no problem. The name of the table is "Help", it has
22 columns, and most of those are named identically to columns in other
tables (ie. "Name", "HouseKeeping_State", "ObjectId", etc). There are
only 5 columns whose names are unique to this table - "Topic",
"SummaryLine", "HelpFile", "ReferenceNumber", and "SectionName". None
of these appear in the list of reserved words for Oracle 8i 8.1.5, and
the fact that there is no problem creating the table would imply that
they are indeed not reserved words.
Remember that over 400 other tables with 2 to 70 columns copy over fine
with the exact same code generating all the statements, array binds,
etc. so I don't think it is a bug in my code. I have also used a
debugger to print the sql insert statement just before it gets sent to
Oracle via the OCI and cut and paste the statement into sqlplus. The
only complaint is about placeholders not being bound (understandable),
but no "Invalid Column Name" error. When I let the program continue,
"Invalid Column Name" is exactly what the OCI gives me.
I am totally stumped - any ideas out there??
Thanks very much for any responses.
Brad Lotsberg, EET.
email: lotsberg_at_willowglen.ab.ca Received on Mon Jun 26 2000 - 00:00:00 CDT