Skip to main content
Solved

Creating Tables with Oracle writer, how do I set the primary key

  • October 13, 2015
  • 1 reply
  • 38 views

Forum|alt.badge.img
Im creating some tables with an oracle spatial writer but its creating them without a primary key.

 

 

I am using a sequence in oracle to increment the value but the created table does not have this ID set to primary key.

 

 

How do I get a table I am creating to set a column to be the primary key?

 

 

(Im in FME 2013)

 

 

 

 

 

 

Best answer by takashi

Hi,

 

 

If the table will be newly created by the writer, you can add the primary key constraint with setting a SQL statement to the "SQL Statment To Execute After Translation" parameter of the writer. The parameter is shown as the a writer parameter (Advanced) in the Navigator window. The syntax may be:

 

-----

 

ALTER TABLE <table name> ADD [CONSTRAINT <key name>] PRIMARY KEY (<column names, comma seperated if multiple columns to be set>);

 

-----

 

Not tested. See also the Oracle documentation about the correct syntax.

 

 

In FME 2014 or later, primary key column(s) can be specified in the writer feature type properties dialog (User Attributes tab).

 

 

Takashi
This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

1 reply

takashi
Celebrity
  • Best Answer
  • October 14, 2015
Hi,

 

 

If the table will be newly created by the writer, you can add the primary key constraint with setting a SQL statement to the "SQL Statment To Execute After Translation" parameter of the writer. The parameter is shown as the a writer parameter (Advanced) in the Navigator window. The syntax may be:

 

-----

 

ALTER TABLE <table name> ADD [CONSTRAINT <key name>] PRIMARY KEY (<column names, comma seperated if multiple columns to be set>);

 

-----

 

Not tested. See also the Oracle documentation about the correct syntax.

 

 

In FME 2014 or later, primary key column(s) can be specified in the writer feature type properties dialog (User Attributes tab).

 

 

Takashi