Focal Point
[ABANDONED] Update in an Auto-Increment Key Table

This topic can be found at:
http://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/2747014196

July 10, 2019, 10:04 AM
John_Edwards
[ABANDONED] Update in an Auto-Increment Key Table
I have an auto-increment table that I'd like to write to in an insert/update fashion.

I have a Data Migrator flow that left-outer-joins the destination table to the source table, so that I can capture the ID of the destination table. I

I pass all my fields from the source table across, and I'm sending the ID field from the destination table as well, which is either an integer (on a match in the join) or a null (on no match in the join).

I can't figure out how to make this run as an insert/update flow. How do I get the database to either a) update the existing record when the keys match; or b) insert when there is no key?

If I try to assign the ID SQL*Server throws and error.* If I don't assign the ID I get duplicate inserts of the same information.

* 07/09/2019 16:20:39 MVGBIBITWF1 (FOC1377) UPDATE OR DELETE FOR KEYS=0 NOT SUPPORTED FOR SUFFIX : SQLMSS

This message has been edited. Last edited by: John_Edwards,



July 10, 2019, 10:17 AM
FP Mod Chuck
John

I found this old post on techsupport.. The Access File (filename.acx) determines read/write ability of the RDBMS.
KEYS=0 indicates read only, KEYS=1 indicates read/write.

Update the Master File (filename.mas) to include SEGTYPE=S0 and update the
Access File (filename.acx) to include KEYS=1 to allow to update the
table without these errors.

I think that the value for KEYS should be the number of fields at the beginning of the master file that make up the actual key fields. There is also a WRITE=YES that can be in the acx as well.


Thank you for using Focal Point!

Chuck Wolff - Focal Point Moderator
WebFOCUS 7x and 8x, Windows, Linux All output Formats
July 10, 2019, 02:01 PM
John_Edwards
Thank you sir!

It didn't work, largely because Access files are much more complicated than they used to be. I made the change and still got data crashing out on the insert of new records.

I redesigned the table to have a composite key and all works well. But I'll tell you what -- this is a BIG shortcoming in Data Migrator. This can be set up in SQL in about a dozen lines of code, Data Migrator can't seem to handle insert/update on a table with an auto-key.



July 10, 2019, 02:08 PM
BabakNYC
Have you considered opening a case with IB Tech support to find out if this is possible?


WebFOCUS 8206, Unix, Windows
July 10, 2019, 03:22 PM
John_Edwards
I'm a contractor that's paid by the hour, so I need to find a solution and move on to keep the customer happy. Rebuilding the table did the job so I'm good, but if someone else wants to present this I'll be interested in the result.