As an example:
I have firebird tables:
TB_CUSTOMER
IDCUSTOMER (autoincrement generator)
CUSTOMERNAME
TB_PHONE
IDPHONE
IDCUSTOMER (foreing key from TB_CUSTOMER)
PHONE
TB_PHONE is handled using a dbgrid. But, I can not assign IDCUSTOMER field value in TB_PHONE because it has not yet been generated in firebird generator.
Any sugest?
IBDAC using dbedits as master and dbgrid as detail with generators
-
marcosdoni
- Posts: 5
- Joined: Thu 20 Jun 2013 19:32
-
AndreyZ
Re: IBDAC using dbedits as master and dbgrid as detail with generators
You can get the next value from the generator using the following SQL statement:, and use it in both your tables as the new value of the IDCUSTOMER field. For more information about generators, please refer to http://www.firebirdsql.org/manual/generatorguide.html
Code: Select all
select next value for generator_name from rdb$database