[patch_done] MySQL Exception "field must have a value&q

Code patches written by our users to solve certain "problems" that were not solved, yet.

Moderators: gto, cipto_kh, EgonHugeist, mdaems

Post Reply
jottel
Fresh Boarder
Fresh Boarder
Posts: 1
Joined: 14.11.2006, 14:15

[patch_done] MySQL Exception "field must have a value&q

Post by jottel »

After changing form 6.5.1a to 6.6.0b I got this exception whenever I posted a new record where I didn't assign values to those fields which are defined NOT NULL and have default values.
I found a solution that works for me.
Change
in ZAbstractRODataSet, procedure InternalFieldDefs

required := IsNullable(I) = ntNoNulls;

to

required := (IsNullable(I) = ntNoNulls)
and not
( ( (GetDefaultValue(I)='') and
(GetColumnType(I) in [stString, stUnicodeString])
)
or (GetDefaultValue(I)<>'') );
User avatar
fduenas
Zeos Dev Team
Zeos Dev Team
Posts: 132
Joined: 26.08.2005, 08:12
Location: Cancún

Post by fduenas »

Also you can set to each "required" field's property to false.
uwwin
Fresh Boarder
Fresh Boarder
Posts: 8
Joined: 20.07.2006, 08:39

Post by uwwin »

you have to change the zquery.sql.text with the simple query.. like 'select * from tbl_a'
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

Jottel,

Please check current version. (SVN snapshot at http://zeosdownloads/downloads/snapshots/). Normally this should work better now after fixing bug #90

Mark
Image
Post Reply