Subject | Field informations: RDB$Null_Flag is wrong |
---|---|
Author | juetho_berlin |
Post date | 2006-11-18T11:21:47Z |
I'm calling field informations via select, but I'm getting wrong answer.
CREATE TABLE KATEG_ORIGINAL (
TEXT VARCHAR(80) NOT NULL,
ID INTEGER DEFAULT 0 NOT NULL );
IBExpert shows that really both fields are not-null. But the following
select says that only 'ID' is not-null, but 'TEXT' would be nullable:
SELECT rel.RDB$Relation_Name AS TableName,
rel.RDB$Field_Name AS FieldName,
rel.RDB$Field_Position AS FieldPos,
fld.RDB$Field_Type AS FeldtypNr,
typ.RDB$Type_Name AS Feldtyp,
fld.RDB$Field_Length AS Laenge,
fld.RDB$Null_Flag AS NotNull
FROM rdb$relation_fields rel
JOIN RDB$Fields fld
ON rel.RDB$Field_Source = fld.RDB$Field_Name
JOIN RDB$Types typ
ON ( (fld.RDB$Field_Type = typ.RDB$Type)
AND (typ.RDB$Field_Name = 'RDB$FIELD_TYPE') )
WHERE (rel.RDB$Relation_Name = 'KOMP_ORIGINAL')
ORDER BY RDB$Relation_Name, RDB$Field_Position
I get the same wrong result with "rel.RDB$Null_Flag" instead of
"fld.RDB$Null_Flag".
How can I get the right result? Thanks! Juergen
PS 1. I'm using Firebird 2.0.0.12724.
PS 2. The select-command could be shorter. But I want to read the
Type_Name and to use a similar version for all my tables.
CREATE TABLE KATEG_ORIGINAL (
TEXT VARCHAR(80) NOT NULL,
ID INTEGER DEFAULT 0 NOT NULL );
IBExpert shows that really both fields are not-null. But the following
select says that only 'ID' is not-null, but 'TEXT' would be nullable:
SELECT rel.RDB$Relation_Name AS TableName,
rel.RDB$Field_Name AS FieldName,
rel.RDB$Field_Position AS FieldPos,
fld.RDB$Field_Type AS FeldtypNr,
typ.RDB$Type_Name AS Feldtyp,
fld.RDB$Field_Length AS Laenge,
fld.RDB$Null_Flag AS NotNull
FROM rdb$relation_fields rel
JOIN RDB$Fields fld
ON rel.RDB$Field_Source = fld.RDB$Field_Name
JOIN RDB$Types typ
ON ( (fld.RDB$Field_Type = typ.RDB$Type)
AND (typ.RDB$Field_Name = 'RDB$FIELD_TYPE') )
WHERE (rel.RDB$Relation_Name = 'KOMP_ORIGINAL')
ORDER BY RDB$Relation_Name, RDB$Field_Position
I get the same wrong result with "rel.RDB$Null_Flag" instead of
"fld.RDB$Null_Flag".
How can I get the right result? Thanks! Juergen
PS 1. I'm using Firebird 2.0.0.12724.
PS 2. The select-command could be shorter. But I want to read the
Type_Name and to use a similar version for all my tables.