foreign key solution..

N

Nicola Delbono

Guest
For the foreign key problem:

managed_table
________________________________
idMT(key) , prodType(int, FOREIGN KEY), shipCost(varchar)
________________________________
1, 2, 30$
2, 2, 20$
3, 1, 20$
4, 3, 20$

foreign_key_table
______________________
id(key), name(varchar)
______________________
1 PRODx
2 PROD2
3 PRODGAMMA
4 PRODPROD


If you want to display
<option value="managed_table.prodType">foreign_key_table.name

It may be useful to let user specify as the FOREIGN_KEY field of DaDaBik interface a SQL: statement like the following.

SQL: SELECT foreign_keyTable.id as idMT, foreign_key_table.name from foreign_key_table

So: if in the resulting row there is a fieldname same as the managed_table field_name, you take the the foreign key ALIASED to insert into the managed_table field ( you insert foreign_keyTable.id as idMT into managed_table.idMT )


Don't know if this may complicate things on the coding side.
 
E

Eugenio

Guest
Nicola Delbono wrote:
>
> For the foreign key problem:
[......]
> If you want to display
> <option value="managed_table.prodType">foreign_key_table.name
>
> It may be useful to let user specify as the FOREIGN_KEY field
> of DaDaBik interface a SQL: statement like the following.
[......]

But at the moment the foreign key support is limited and doesn't give the possibility to specify different value and value displayed (managed_table.prodType foreign_key_table.name) in a select field.

(Latest version of DaDaBIK when this message was posted: 1.8)
 
Top