Subject Re: [IBO] Newbie question (Interbase Insert error)
Author Helen Borrie
At 08:16 PM 1/06/2004 +0000, you wrote:
>I have a field called PROJ_ID which is the Primary Key in an
>interbase table.
>
>When I try to save a new record I get an exception
>'PRJ_ID is a required field'.
>
>Is there a way to calculate the value in the client app?
>
>I am using IB_Query.

Calculating key values on the client is a mistake. Ideally, pull PKs from
a generator (as described by Constantin) and set the GeneratorLinks
value(s) in the client.

Format of GeneratorLinks is column_name=generator_name. You can set them
one by one in the statement object (query, cursor, etc.) or globally (with
table identifiers) in the connection object (connection, ibodatabase, etc.)

(in the query object)
MyPK=MyPKGen

(in the connection object)
MyTable.MyPK=MyPKGen
AnotherTable.PK=AnotherPKGen

When GeneratorLinks are defined, they kick in automatically when you call
Insert on the client.

Helen