Inserts into ADABAS SQL gateway

Our using has a tool that is building the INSERTS but the primary key is the ISN. Since they don’t provide a number for the insert, it blows up with an SQL error (primary key cannot be null).
What is the normal technique to solve this issue? Do you query the file and capture the highest ISN then add 1 to it and do the INSERT? or is there a cleaner way to accomplish this?
Craig Soehnlin

Is there no way around having the ISN as the primary key ?

Generally, the ISN-Field should not be included in the INSERT statement.

For Example - the following table was created by FDT IMPORT
and contains the columns:

  • AA
  • AB

The recommended syntax for INSERT is -
insert into ADABAS_FILE_19 (AA, AB) values (‘TEXT VALUE’, 12345);

Mandatory Usage:
The ISN-Field must be used, is when inserting values into a Sub-Table; e.g. a table representing an MU-Field or a PE-Group. In this case the usage ISN is mandatory, as it is part of the FOREIGN KEY releationship.

Our tables were created using the SYSTRANS IMPORT feature of the data dictionary for COONNX. By default, every table received a primary key of ISN. I thought that was how CONNX was supposed to work. Once it is the primary keyk, you cannot do an INSERT without it, right? Or are you saying that CONNX will allow that to pass through?

Adabas will automatically assign the ISN.

With the exception of INSERTing into Sub-Tables,
it is thus recommended NOT to provide the ISN during an INSERT.

Thank you Richard for that answer. I am going to ask the user to call the company that makes Hibernate and see what they need to do to make it recognize the ISN field as an “identity” field.

On the UI, sometimes we need to access the data only from Adabas, … One way to solve this problem, is to define a Linked Server in SQL

i am agree to your comment. your idea is all right. :roll: