Skip to main content
Solved

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

  • October 13, 2015
  • 1 reply
  • 21 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
View original
Did this help you find an answer to your question?
This post is closed to further activity.
It may be a question with a best answer, an implemented idea, or just a post needing no comment.
If you have a follow-up or related question, 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
Contributor
Forum|alt.badge.img+19
  • Contributor
  • 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

Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings