Problems with Primary Key Feature

C

Chris O'Haver

Guest
I am encountering 2 problems.

The first is that if you set up a foreign key for a select one field, its value cannot be null. This is a problem when the field is optional. The result is an illegal SQL statment, ending in an "=" . The solution would be to insert "NULL" when comparing against a null value instead of inserting nothing.

The second problem is that you cannot set up a key to the same table... for example. If I have a table called "node", and in it, column called "parent_node" which is intented to refer to another node in the same table. I would like dadabik to display a list of nodes in the "parent_node" form field. However, this cannot be done. The result is a SQL query with non unique table names. The solution would be to create unique aliases for each table name in the query.
Suggestion: alias all tables with a _1, _2, _3, etc appended to the end... even if they dont need to be.


If I get around to fixing these myself I'll let you know.

Thanks!
 
S

simon

Guest
This is the exact proble that I have. Please let me knwo if there was a fix


Kind Regards


Simon
 
E

Eugenio

Guest
Chris O'Haver wrote:

> I am encountering 2 problems.
>
> The first is that if you set up a foreign key for a select
> one field, its value cannot be null. This is a problem when
> the field is optional. The result is an illegal SQL statment,
> ending in an "=" . The solution would be to insert "NULL" when
> comparing against a null value instead of inserting nothing.

Could you explain better? You mean the value of which field could not be null? During which procedure do you get the error? Could you provide an example?

> The second problem is that you cannot set up a key to the
> same table... for example.

[....]

Unfortunately this is a bug of v3.0 beta, see here:
http://www.dadabik.org/forum/read.php?f=1&i=2374&t=2374


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