ODBC Table adding column I didn't select

41 views
Skip to first unread message

PeterS

unread,
May 17, 2013, 2:38:03 PM5/17/13
to mapi...@googlegroups.com
Hi, I hope someone out there can help with this question.

I have an oracle table, geo_details, that I am creating a live connection to through MapInfo. The table contains these columns:
Recid,
entityID,
sourceID,
Lat,
Long

with entityID and SourceID being primary keys and recid set by our database team to auto-increment.

When creating the ODBC table in MapInfo I am only selecting these columns:
entityID,
SourceID,
Lat,
Long

However, when the ODBC table is created it is bringing in the Recid column and messing up the insert I am trying to do.
this is my connection string:

Register Table "Geo_details"  TYPE ODBC TABLE "Select ""ENTITYID"",""SOURCEID"",""Y_LAT"",""X_LONG""  From ""GIS"".""GEO_DETAILS""" CONNECTION "DSN=xxx;UID=xxx;PWD=xxxxxx;" toolkit  "ODBC" Autokey OFF Versioned Off Workspace "" ParentWorkspace "" Into "C:\Temp\Geo_details.tab"

Is there a way to make sure the recID column is not being brought into my table?

Thanks,
Peter

Peter Horsbøll Møller

unread,
May 21, 2013, 4:07:41 AM5/21/13
to mapi...@googlegroups.com
Peter,

MapInfo Pro requires a single column with a unique ID when you open a table as live (or when you want to edit the table from MapInfo Pro).

That's probably why you see that MI Pro is also bringing in the RecID.

Why does this mess up your insert statement?
You shouldn't insert values into the RecID as this column is "handled" by Oracle.

You can specify which columns to insert into and so leave out the RecID column:

Insert Into Geo_details
   (entityID, SourceID, Lat, Long)
   ...

HTH

Peter Horsbøll Møller
Pitney Bowes Software



Date: Fri, 17 May 2013 11:38:03 -0700
From: peter.s...@gmail.com
To: mapi...@googlegroups.com
Subject: [MI-L] ODBC Table adding column I didn't select
Reply all
Reply to author
Forward
0 new messages