Error when trying to insert records into an external table

Posted by ByronB on 19-Aug-2015 03:10

Hi there

So we have a situation where I cant seem to figure out whats going on. We have external tables which we write to from RB tables. The external table already has data in it with the ID field as an auto number column. The first time I try to insert a record the records inserts no worries (taking the next available ID), after that if I try and insert again I get the following error:

Error Wrapped com.rb.core.data.a389: Id "1" is already in use. (line #32) in formula:

Any idea whats causing this? We have tried repairing the external table etc but nothing helps.

Any help would be greatly appreciated.

Error Wrapped com.rb.core.data.a389: Id "1" is already in use. (line #32) in formula:

All Replies

Posted by kiran kumar Angara on 19-Aug-2015 04:55

Hi,

I think the record which you are trying to create has restrictions on one of the field that needs to be unique.

I mean the ID field you created/Mapped is primary key (Do not allow duplicate is checked for the field in field definition) for the object you created using External Tables.

Thanks & Regards,

Kiran Avs.

Posted by ByronB on 19-Aug-2015 05:46

Thanks kangara

Yes the ID field is uniques as it should be isnt it? The next available number should be used for the ID field?

Posted by kiran kumar Angara on 19-Aug-2015 07:41

Hi Byron,

Can you tell me the Rollbase version which you are using and the database which is running in backend.

Thanks & regards,

Kiran Avs.

Posted by ByronB on 19-Aug-2015 09:31

Hi bud

RB version: 3.2.0.0

Backend is MySQL

Posted by Pradeep Kagithalagudem on 21-Aug-2015 05:09

Hi Byron,

In this case as you have auto number in external db table so please adjust the insert SQL query and remove the auto number field.

Open Object Definition page

More Actions -> Adjust SQL Queries

Modify the insert sql query appropriately to resolve your problem

Thanks and Regards

Pradeep

Posted by kiran kumar Angara on 21-Aug-2015 07:11

Hi Byron,

I tested in my local setup with backend database as MySQL with new test bits. There were few considerable changes  for auto- number field  in upcoming release. And it is working fine. Will check with 3.2 build and get back to you.

Thanks & Regards,

Kiran Avs.

This thread is closed