In The latest Release from 13.10.2005 Zeos test the notNull property of an Field.
Problem
In my Table was the Defaultvalue of any Fields set by the Default Value from the Postgresql Fieldproperty or by an Sequence.
Zeos handle an Exception if there is no Value in any of this Fields. The Fieldvalue is Set by the Database.
Why is that so ?
Can I disable this way ?
Thanks
Jörg Nissen
Required Property
Moderators: gto, cipto_kh, EgonHugeist
I had the same problem on fields with default values.
Zeos does not permit a field to be 'nullable' if it's defined as not null.
So i did a nasty patch in ZDbcPostgresSqlMetadata, to allow fields with
default values (and not null defined) be nullables.
ZDbcPostgreSQLMetadata.pas
function TZPostgreSQLDatabaseMetadata.GetColumns(Catalog: string;
SchemaPattern: string; TableNamePattern: string;
ColumnNamePattern: string): IZResultSet;
scope
change:
sorry my english.
Niztor.-
Zeos does not permit a field to be 'nullable' if it's defined as not null.
So i did a nasty patch in ZDbcPostgresSqlMetadata, to allow fields with
default values (and not null defined) be nullables.
ZDbcPostgreSQLMetadata.pas
function TZPostgreSQLDatabaseMetadata.GetColumns(Catalog: string;
SchemaPattern: string; TableNamePattern: string;
ColumnNamePattern: string): IZResultSet;
scope
Code: Select all
Result.UpdateNull(8);
if GetBooleanByName('attnotnull') then
begin
Result.UpdateString(18, 'NO');
Result.UpdateInt(11, Ord(ntNoNulls));
end
else
begin
Result.UpdateString(18, 'YES');
Result.UpdateInt(11, Ord(ntNullable));
end;
Code: Select all
if GetBooleanByName('attnotnull') and (GetStringByName('adsrc') = '')
then
begin
Niztor.-