Value for primary key is not defined?

If you think that something doesn't work in Aware IM post your message here
Post Reply
hpl123
Posts: 2609
Joined: Fri Feb 01, 2013 1:13 pm
Location: Scandinavia

Value for primary key is not defined?

Post by hpl123 »

Hi support,
I have a peculiar problem I don´t understand and hoping for some enlightenment from you (or anyone else that knows the answer). I try to connect to an external database using a MySQL auto-incremented number field as primary key and I get the error message "Value for primary key meta_id is not defined." which isn´t correct (the meta_id is auto-incremented and all rows are populated).

Aware settings:
db1.PNG
db1.PNG (5.46 KiB) Viewed 29896 times
DB field settings:
db2.PNG
db2.PNG (9.66 KiB) Viewed 29896 times
Thanks in advance
Henrik (V8 Developer Ed. - Windows)
hpl123
Posts: 2609
Joined: Fri Feb 01, 2013 1:13 pm
Location: Scandinavia

Unsigned culprit

Post by hpl123 »

Update:
The problem seems to be that the field use the "unsigned" setting for the field, I removed it and then all works as it should. Is this a bug or can´t Aware handle unsigned? The problem is not just with the primary key thing, Aware can´t read unsigned fields at all (all unsigned fields are displayed as empty in Aware queries).

Thanks
Henrik (V8 Developer Ed. - Windows)
aware_support
Posts: 7526
Joined: Sun Apr 24, 2005 12:36 am
Contact:

Re: Value for primary key is not defined?

Post by aware_support »

Sounds like a bug. We'll check it out
Aware IM Support Team
aware_support
Posts: 7526
Joined: Sun Apr 24, 2005 12:36 am
Contact:

Re: Value for primary key is not defined?

Post by aware_support »

Seems to work fine in our tests...
Aware IM Support Team
hpl123
Posts: 2609
Joined: Fri Feb 01, 2013 1:13 pm
Location: Scandinavia

Re: Value for primary key is not defined?

Post by hpl123 »

Not sure what you are testing etc. but the bug is if the DB field has "unsigned" enabled for the primary key field/column. If it has, Aware does not display the value in the primary key field in Aware queries etc. and it also not possible to change stuff. In your tests, do you see the value of the primary key field in Aware? Can you change stuff? Is the field set with unsigned enabled in the DB?
Henrik (V8 Developer Ed. - Windows)
aware_support
Posts: 7526
Joined: Sun Apr 24, 2005 12:36 am
Contact:

Re: Value for primary key is not defined?

Post by aware_support »

I have created an integer column in MySQL with the UNSIGNED attribute. When discovering attributes for the table I have specified this column to be the primary key. Then I have defined a query that shows values of this table and the Edit operation with records.

The query works fine and I can also edit and change records (not the primary key, though)
Aware IM Support Team
hpl123
Posts: 2609
Joined: Fri Feb 01, 2013 1:13 pm
Location: Scandinavia

Re: Value for primary key is not defined?

Post by hpl123 »

aware_support wrote:I have created an integer column in MySQL with the UNSIGNED attribute. When discovering attributes for the table I have specified this column to be the primary key. Then I have defined a query that shows values of this table and the Edit operation with records.

The query works fine and I can also edit and change records (not the primary key, though)
Strange, sounds right and same as my setup and does not work for me. I am on v8.2 b2565.
Henrik (V8 Developer Ed. - Windows)
hpl123
Posts: 2609
Joined: Fri Feb 01, 2013 1:13 pm
Location: Scandinavia

Re: Value for primary key is not defined?

Post by hpl123 »

This problem still exists today. I was trying to connect to a WP DB and had the same exact issue + solution. I am on Aware 8.5 (build 2830).
Henrik (V8 Developer Ed. - Windows)
Post Reply