We are using the 'Write to Data Store' smart process to write data into an Oracle DB v18c. The column 'ID' is a primary key and is auto-generated by the DB via a 'before insert' trigger that is calling a sequence. In the XSD file of the corresponding CDT we have the annotations @Id @GeneratedValue.
Writing data to the DB works fine. However, the ID value returned from the 'Write to Data Store' process is incorrect. Seems like a different sequence is used.
Any suggestions on how to solve this problem are highly appreciated. Thank you in advance!
Discussion posts and replies are publicly visible
we use Oracle as DB and this is an example of a CDT for the primary key field
<xsd:element name="ID_GENERIC_TABLE_NAME" nillable="true" type="xsd:int"> <xsd:annotation> <xsd:appinfo source="appian.jpa">@Id @Column(name="ID_GENERIC_TABLE_NAME", nullable=false, columnDefinition="NUMBER") @SequenceGenerator(name="SQ_GENERIC_TABLE_NAME", sequenceName="SQ_GENERIC_TABLE_NAME") @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="SQ_GENERIC_TABLE_NAME") </xsd:appinfo> </xsd:annotation> </xsd:element>
Hi, I have the same structure in the cdt but I still got the error: when I write in the output of the writeToMultipleDataStore I got an integer as ID while on DB I got an ID decremented by one respect the ID on Appian. Do you have any idea?
please verify that all the cdts pointing to the same table are using the same sequence for the PK, also in the sequence defintion must be incremented by one
© 2023 Appian. All rights reserved.