Question

How to serial primary key in Oracle spatial object writer using with user attributes part?

  • 31 December 2021
  • 5 replies
  • 6 views

Badge

resim_2021-12-31_114518As you see, value is null so it gets ORA-01449(null).So, How can I setting value collumn ?


5 replies

Badge

when I tried UUID() but is does not work.

In addition, when I select postgre writer, it gets serial parameter like this;

resim_2021-12-31_115444

BUT, when I choose oracle writer, it does not have any serial parameter for primary key?

 

Badge +10

Hi @ikubra800​. The data types for each format is based on the specific format. PostgreSQL supports the "serial" data type, where Oracle doesn't, therefore it isn't available in the Oracle Writer. Hope that makes sense.

I see from your screenshot above that you had SEQ_ID datatype set to "number." If you're using the UUID() function in the text editor from the writer feature type as shown below, ensure you have set a Data Type that supports the UUID values (i.e. clob).

If the UUID() function doesn't work for some other reason, try adding the UUIDGenerator transformer prior to writing and set the "New UUID Attribute" to SEQ_ID.

Hope this helps!

Badge

Thanks @nampreetatsafe it works, ı choose varchar because oracle dont support LOB type as primary key. So, it create pk with string in FME.

works

Badge +2

@ikubra800​ Just for completeness... Oracle sequences are analogous to the postgres serial data type.

The sequence must be an integer data type on the Oracle writer. It can also be the primary key. To use a sequence you can set the Sequenced Table Columns parameter on the Oracle Writer Feature Type Advanced disclosure group:

dialogA bit more on using Oracle sequences in this article: Making use of Oracle Sequences when working with Oracle Tables

Badge

Thanks @Mark Stoakes​  for the response.​ 

Reply