Subject Problem with persistant field type
Author Paul Coshott
Hi All,

I have a firebird database that has a simple table defind in it called "tbl_Country".
One of the fields is called "Country" and is a VarChar(64). But when I setup an ibo query component (Select * From "tbl_Country"), the Country field is being created as a memo field. If I add the field as a persistant field in the field editor, it is created as a TMemoField type.

The DDL as reported by Database Workbench 4 is below. Anyone know why this is happening ?

I am using D2009 Pro with IBO 4.9.9

Cheers,
Paul


CREATE TABLE "tbl_Country"
(
MFK$GUID CHAR( 16) CHARACTER SET OCTETS NOT NULL COLLATE OCTETS,
MFK$CTS TIMESTAMP,
MFK$LMTS TIMESTAMP,
"Country" VARCHAR( 64) COLLATE UNICODE,
"CountryId" INTEGER NOT NULL,
PRIMARY KEY ("CountryId")
);
update rdb$relations set rdb$description = '<?xml version="1.0" encoding="UTF8"?>
<FBTableExtensionBlock>
<mfk:section mfk:name="$TEB_SUBTYPE">
<mfk:section mfk:name="MFK$GUID">8</mfk:section>
<mfk:section mfk:name="CountryId">1</mfk:section>
</mfk:section>
<mfk:section mfk:name="$TEB_DEFAULTVAL">
<mfk:section mfk:name="MFK$GUID">GenerateGUIDEx()</mfk:section>
</mfk:section>
<mfk:section mfk:name="$TEB_FIELDRELATIONSHIPKIND">
<mfk:section mfk:name="MFK$GUID">0</mfk:section>
<mfk:section mfk:name="MFK$CTS">0</mfk:section>
<mfk:section mfk:name="MFK$LMTS">0</mfk:section>
<mfk:section mfk:name="Country">0</mfk:section>
<mfk:section mfk:name="CountryId">0</mfk:section>
</mfk:section>
<mfk:section mfk:name="$TEB_GEN">
<mfk:section mfk:name="MFK$GUID">GUID:1:1</mfk:section>
<mfk:section mfk:name="CountryId"><TABLENAME>_G1:1:1</mfk:section>
</mfk:section>
<mfk:section mfk:name="$TEB_POSITION">
<mfk:section mfk:name="Country">2</mfk:section>
<mfk:section mfk:name="CountryId">1</mfk:section>
</mfk:section>
</FBTableExtensionBlock>
' where rdb$relation_name = 'tbl_Country';

CREATE UNIQUE ASC INDEX "tbl_Country_X1" ON "tbl_Country" (MFK$GUID);

CREATE ASC INDEX "tbl_Country_X2" ON "tbl_Country" (MFK$CTS);

CREATE ASC INDEX "tbl_Country_X3" ON "tbl_Country" ("Country");


SET TERM ^^ ;
CREATE TRIGGER "tbl_Country_TBI" FOR "tbl_Country" ACTIVE BEFORE INSERT POSITION 0 AS
BEGIN
NEW.MFK$CTS = GetTime();
NEW.MFK$LMTS = GetTime();
IF ((NEW.MFK$GUID IS NULL) OR (NEW.MFK$GUID='GenerateGUIDEx()')) THEN
NEW.MFK$GUID = GenerateGUIDEx();
NEW."CountryId" = GEN_ID("tbl_Country_G1",1);
END ^^
SET TERM ; ^^


SET TERM ^^ ;
CREATE TRIGGER "tbl_Country_TBU" FOR "tbl_Country" ACTIVE BEFORE UPDATE POSITION 0 AS
BEGIN
NEW.MFK$LMTS = GetTime();
END ^^
SET TERM ; ^^