Home -
General /
All posts - Specifying a DBMS Identity Column on export
|
Does anyone know if it is possible to specify the identifier column of an export to Oracle to a value other than the default of [OID] when programmatically exporting layers using: ExportDrawing(Drawing drawing, String name, String type, Number srid, Boolean createIndex, Boolean createSequenceTriggers, DataSourceColumnSet columns) I am guessing that it can be done using UI Scripting but really don't want to do down this route if it can be avoided.
Landsystems Ltd ... Know your land | www.landsystems.co.nz |
jsperr143 post(s) |
It seems possible -- here's an excerpt from the users manual: Export Drawing - OracleExport Drawing Dialog Controls Identity Allows customizing the name of the identity column. OID by default.
|
|
Thanks jsperr, I have a feeling that this is only accessible via the GUI or UI Scripting which is a route that I don't want to take if I can avoid. Further to this, I can't seem to set the primary key to an existing unique column via the exporter, so will likely have to reset the PK post export.
Landsystems Ltd ... Know your land | www.landsystems.co.nz |
|
What are the downsides of using UI scripting in this case? Are there any ways to work around them?
|
|
Typically that in my experience it tends to not be very robust, though I am aware that this can be worked around. Since posting the original question, I have found that I can't set the identity/primary key to an existing unique column in the data table when exporting via the DataSource object. Even if you change the identity column from the default [OID] column name, the specified column will be added by the Manifold exporter with a unique sequence of numbers from 1 -> x. In my case I might want to set it to an existing unique column e.g. [FARM_ID] perhaps containing unique identifier strings. This is a bit of a show stopper for the original workflow I had in mind, though I can do this post export via the Oracle call interface, so I should be ok.
Landsystems Ltd ... Know your land | www.landsystems.co.nz |
|
I don't think anyone has ever posted an example where UI scripting is not robust, provided that thread timing is properly handled. That's not as easy as normal scripting, but it is clear what to do. (In firsttube's recent example he thought a couple of external factors might be causing a problem, but that's not confirmed yet, and in any case the code there does not handle thread timing at all points.)
|
|
Should add: I think there are there are situations where timing issues are unexpected, possibly inexplicable--even if no one has posted an example, unfortunately.
|