Subject Re: odd issue with firebird
Author C.J.
Thank You Helen,

I will post the part of the real export that is related to this issue.
and the query used to pull the information will be listed below. Maybe
this will clarify an questions that you have.

I will point out the areas that were changed in italics.

CREATE TABLE "FIELDS"
(
"FIELD_REC_NO" INTEGER NOT NULL,
"FORM_NAME" CHAR(30) NOT NULL,
"FIELD_NAME" CHAR(30) NOT NULL,
"LAB_CAPTION_NO" INTEGER default 1 NOT NULL,
"LAB_FONT_NAME" CHAR(30) default 'MS Sans Serif' NOT NULL,
"LAB_COLOR" CHAR(9) default '$00000000' NOT NULL,
"LAB_BG_COLOR" CHAR(9) default '$00E0DFE3' NOT NULL,
"FLD_FONT_NAME" CHAR(30) Default 'MS Sans Serif' NOT NULL,
"FLD_COLOR" CHAR(9) default '$00000000' NOT NULL,
"FLD_BG_COLOR" CHAR(9) default '$00FFFFFF' NOT NULL,
"FLD_WIDTH" SMALLINT Default 100 NOT NULL,
"FLD_EDIT_MASK_NO" INTEGER default 1 NOT NULL,
"FONT_SIZE" SMALLINT Default 10 NOT NULL,
PRIMARY KEY ("FIELD_REC_NO")
);

CREATE TABLE "LABELS"
(
"LABEL_REC_NO" INTEGER NOT NULL,
"LABEL_NAME" CHAR(30) NOT NULL,
PRIMARY KEY ("LABEL_REC_NO")
);

CREATE GENERATOR "G$_FIELD_REC_NO";
CREATE GENERATOR "G$_LABEL_REC_NO";

INSERT INTO "LABELS" ("LABEL_REC_NO", "LABEL_NAME") VALUES
(1,'Unknown');
INSERT INTO "LABELS" ("LABEL_REC_NO", "LABEL_NAME") VALUES
(2,'Company');
INSERT INTO "LABELS" ("LABEL_REC_NO", "LABEL_NAME") VALUES (3,'Street');
INSERT INTO "LABELS" ("LABEL_REC_NO", "LABEL_NAME") VALUES
(4,'Mailing');
INSERT INTO "LABELS" ("LABEL_REC_NO", "LABEL_NAME") VALUES (5,'City');
INSERT INTO "LABELS" ("LABEL_REC_NO", "LABEL_NAME") VALUES (6,'State');
INSERT INTO "LABELS" ("LABEL_REC_NO", "LABEL_NAME") VALUES
(7,'Country');
INSERT INTO "LABELS" ("LABEL_REC_NO", "LABEL_NAME") VALUES (8,'Postal');
INSERT INTO "LABELS" ("LABEL_REC_NO", "LABEL_NAME") VALUES (9,'Main
Phone');
INSERT INTO "LABELS" ("LABEL_REC_NO", "LABEL_NAME") VALUES (10,'Fax
Line');
INSERT INTO "LABELS" ("LABEL_REC_NO", "LABEL_NAME") VALUES (11,'Cell
Phone');
INSERT INTO "LABELS" ("LABEL_REC_NO", "LABEL_NAME") VALUES
(13,'Website');
INSERT INTO "LABELS" ("LABEL_REC_NO", "LABEL_NAME") VALUES (14,'Email');
INSERT INTO "LABELS" ("LABEL_REC_NO", "LABEL_NAME") VALUES (15,'Asset
ID');
INSERT INTO "LABELS" ("LABEL_REC_NO", "LABEL_NAME") VALUES
(16,'Description');
INSERT INTO "LABELS" ("LABEL_REC_NO", "LABEL_NAME") VALUES (17,'Asset
Type');
INSERT INTO "LABELS" ("LABEL_REC_NO", "LABEL_NAME") VALUES (18,'Asset
Group');
INSERT INTO "LABELS" ("LABEL_REC_NO", "LABEL_NAME") VALUES
(19,'Manufacturer');
INSERT INTO "LABELS" ("LABEL_REC_NO", "LABEL_NAME") VALUES
(20,'Vendor');
INSERT INTO "LABELS" ("LABEL_REC_NO", "LABEL_NAME") VALUES (21,'Purchase
Amount');
INSERT INTO "LABELS" ("LABEL_REC_NO", "LABEL_NAME") VALUES (22,'Purchase
Date');
INSERT INTO "LABELS" ("LABEL_REC_NO", "LABEL_NAME") VALUES (23,'Life
Span (in days)');
INSERT INTO "LABELS" ("LABEL_REC_NO", "LABEL_NAME") VALUES (24,'Break
Even (%)');
INSERT INTO "LABELS" ("LABEL_REC_NO", "LABEL_NAME") VALUES (25,'Image');
INSERT INTO "LABELS" ("LABEL_REC_NO", "LABEL_NAME") VALUES (26,'Note');
INSERT INTO "LABELS" ("LABEL_REC_NO", "LABEL_NAME") VALUES (27,'Asset
Traits');

INSERT INTO "FIELDS" ("FIELD_REC_NO", "FORM_NAME", "FIELD_NAME",
"LAB_CAPTION_NO", "LAB_FONT_NAME", "LAB_COLOR", "LAB_BG_COLOR",
"FLD_FONT_NAME", "FLD_COLOR", "FLD_BG_COLOR", "FLD_WIDTH",
"FLD_EDIT_MASK_NO", "FONT_SIZE")
VALUES (1,'fCompanies','CompNameFld',2,'MS Sans
Serif','$00000000','$00E0DFE3','MS Sans
Serif','$00000000','$00FFFFFF',100,1,10);


INSERT INTO "FIELDS" ("FIELD_REC_NO", "FORM_NAME", "FIELD_NAME",
"LAB_CAPTION_NO", "LAB_FONT_NAME", "LAB_COLOR", "LAB_BG_COLOR",
"FLD_FONT_NAME", "FLD_COLOR", "FLD_BG_COLOR", "FLD_WIDTH",
"FLD_EDIT_MASK_NO", "FONT_SIZE")
VALUES (3,'fCompanies','CompStreetFld',3,'MS Sans
Serif','$00000000','$00E0DFE3','MS Sans
Serif','$00000000','$00FFFFFF',100,1,10);


INSERT INTO "FIELDS" ("FIELD_REC_NO", "FORM_NAME", "FIELD_NAME",
"LAB_CAPTION_NO", "LAB_FONT_NAME", "LAB_COLOR", "LAB_BG_COLOR",
"FLD_FONT_NAME", "FLD_COLOR", "FLD_BG_COLOR", "FLD_WIDTH",
"FLD_EDIT_MASK_NO", "FONT_SIZE")
VALUES (4,'fCompanies','CompMailingFld',4,'MS Sans
Serif','$00000000','$00E0DFE3','MS Sans
Serif','$00000000','$00FFFFFF',100,1,10);


INSERT INTO "FIELDS" ("FIELD_REC_NO", "FORM_NAME", "FIELD_NAME",
"LAB_CAPTION_NO", "LAB_FONT_NAME", "LAB_COLOR", "LAB_BG_COLOR",
"FLD_FONT_NAME", "FLD_COLOR", "FLD_BG_COLOR", "FLD_WIDTH",
"FLD_EDIT_MASK_NO", "FONT_SIZE")
VALUES (5,'fCompanies','CompCityLUFld',5,'MS Sans
Serif','$00000000','$00E0DFE3','MS Sans
Serif','$00000000','$00FFFFFF',100,1,10);


INSERT INTO "FIELDS" ("FIELD_REC_NO", "FORM_NAME", "FIELD_NAME",
"LAB_CAPTION_NO", "LAB_FONT_NAME", "LAB_COLOR", "LAB_BG_COLOR",
"FLD_FONT_NAME", "FLD_COLOR", "FLD_BG_COLOR", "FLD_WIDTH",
"FLD_EDIT_MASK_NO", "FONT_SIZE")
VALUES (6,'fCompanies','CompStateLUFld',6,'MS Sans
Serif','$00000000','$00E0DFE3','MS Sans
Serif','$00000000','$00FFFFFF',100,1,10);


INSERT INTO "FIELDS" ("FIELD_REC_NO", "FORM_NAME", "FIELD_NAME",
"LAB_CAPTION_NO", "LAB_FONT_NAME", "LAB_COLOR", "LAB_BG_COLOR",
"FLD_FONT_NAME", "FLD_COLOR", "FLD_BG_COLOR", "FLD_WIDTH",
"FLD_EDIT_MASK_NO", "FONT_SIZE")
VALUES (7,'fCompanies','CompCountryLUFld',7,'MS Sans
Serif','$00000000','$00E0DFE3','MS Sans
Serif','$00000000','$00FFFFFF',100,1,10);

this is the record that gave me grief. And even in the export is "out of
place". Before I rebuilt the table with this information I changed the
value of FIELD_REC_NO from 35 to 14 and moved it below.

INSERT INTO "FIELDS" ("FIELD_REC_NO", "FORM_NAME", "FIELD_NAME",
"LAB_CAPTION_NO", "LAB_FONT_NAME", "LAB_COLOR", "LAB_BG_COLOR",
"FLD_FONT_NAME", "FLD_COLOR", "FLD_BG_COLOR", "FLD_WIDTH",
"FLD_EDIT_MASK_NO", "FONT_SIZE")
VALUES (35,'fAssets','assetIdentityFld',15,'MS Sans
Serif','$00000000','$00E0DFE3','MS Sans
Serif','$00000000','$00FFFFFF',100,1,10);

INSERT INTO "FIELDS" ("FIELD_REC_NO", "FORM_NAME", "FIELD_NAME",
"LAB_CAPTION_NO", "LAB_FONT_NAME", "LAB_COLOR", "LAB_BG_COLOR",
"FLD_FONT_NAME", "FLD_COLOR", "FLD_BG_COLOR", "FLD_WIDTH",
"FLD_EDIT_MASK_NO", "FONT_SIZE")
VALUES (8,'fCompanies','CompPostalFld',8,'MS Sans
Serif','$00000000','$00E0DFE3','MS Sans
Serif','$00000000','$00FFFFFF',100,1,10);


INSERT INTO "FIELDS" ("FIELD_REC_NO", "FORM_NAME", "FIELD_NAME",
"LAB_CAPTION_NO", "LAB_FONT_NAME", "LAB_COLOR", "LAB_BG_COLOR",
"FLD_FONT_NAME", "FLD_COLOR", "FLD_BG_COLOR", "FLD_WIDTH",
"FLD_EDIT_MASK_NO", "FONT_SIZE")
VALUES (9,'fCompanies','CompPhone1Fld',9,'MS Sans
Serif','$00000000','$00E0DFE3','MS Sans
Serif','$00000000','$00FFFFFF',100,1,10);


INSERT INTO "FIELDS" ("FIELD_REC_NO", "FORM_NAME", "FIELD_NAME",
"LAB_CAPTION_NO", "LAB_FONT_NAME", "LAB_COLOR", "LAB_BG_COLOR",
"FLD_FONT_NAME", "FLD_COLOR", "FLD_BG_COLOR", "FLD_WIDTH",
"FLD_EDIT_MASK_NO", "FONT_SIZE")
VALUES (10,'fCompanies','CompPhone2Fld',10,'MS Sans
Serif','$00000000','$00E0DFE3','MS Sans
Serif','$00000000','$00FFFFFF',100,1,10);


INSERT INTO "FIELDS" ("FIELD_REC_NO", "FORM_NAME", "FIELD_NAME",
"LAB_CAPTION_NO", "LAB_FONT_NAME", "LAB_COLOR", "LAB_BG_COLOR",
"FLD_FONT_NAME", "FLD_COLOR", "FLD_BG_COLOR", "FLD_WIDTH",
"FLD_EDIT_MASK_NO", "FONT_SIZE")
VALUES (11,'fCompanies','CompPhone3Fld',11,'MS Sans
Serif','$00000000','$00E0DFE3','MS Sans
Serif','$00000000','$00FFFFFF',100,1,10);


INSERT INTO "FIELDS" ("FIELD_REC_NO", "FORM_NAME", "FIELD_NAME",
"LAB_CAPTION_NO", "LAB_FONT_NAME", "LAB_COLOR", "LAB_BG_COLOR",
"FLD_FONT_NAME", "FLD_COLOR", "FLD_BG_COLOR", "FLD_WIDTH",
"FLD_EDIT_MASK_NO", "FONT_SIZE")
VALUES (12,'fCompanies','CompWebsiteFld',13,'MS Sans
Serif','$00000000','$00E0DFE3','MS Sans
Serif','$00000000','$00FFFFFF',100,1,10);


INSERT INTO "FIELDS" ("FIELD_REC_NO", "FORM_NAME", "FIELD_NAME",
"LAB_CAPTION_NO", "LAB_FONT_NAME", "LAB_COLOR", "LAB_BG_COLOR",
"FLD_FONT_NAME", "FLD_COLOR", "FLD_BG_COLOR", "FLD_WIDTH",
"FLD_EDIT_MASK_NO", "FONT_SIZE")
VALUES (13,'fCompanies','CompEmailFld',14,'MS Sans
Serif','$00000000','$00E0DFE3','MS Sans
Serif','$00000000','$00FFFFFF',100,1,10);

This is where I copied the above record to. All the following record had
their FIELD_REC_NO change to be one more than the previous starting from
14. No other changes where made.


INSERT INTO "FIELDS" ("FIELD_REC_NO", "FORM_NAME", "FIELD_NAME",
"LAB_CAPTION_NO", "LAB_FONT_NAME", "LAB_COLOR", "LAB_BG_COLOR",
"FLD_FONT_NAME", "FLD_COLOR", "FLD_BG_COLOR", "FLD_WIDTH",
"FLD_EDIT_MASK_NO", "FONT_SIZE")
VALUES (36,'fAssets','assetDescriptionFld',16,'MS Sans
Serif','$00000000','$00E0DFE3','MS Sans
Serif','$00000000','$00FFFFFF',100,1,10);


INSERT INTO "FIELDS" ("FIELD_REC_NO", "FORM_NAME", "FIELD_NAME",
"LAB_CAPTION_NO", "LAB_FONT_NAME", "LAB_COLOR", "LAB_BG_COLOR",
"FLD_FONT_NAME", "FLD_COLOR", "FLD_BG_COLOR", "FLD_WIDTH",
"FLD_EDIT_MASK_NO", "FONT_SIZE")
VALUES (37,'fAssets','assetTypeNoLUFld',17,'MS Sans
Serif','$00000000','$00E0DFE3','MS Sans
Serif','$00000000','$00FFFFFF',100,1,10);


INSERT INTO "FIELDS" ("FIELD_REC_NO", "FORM_NAME", "FIELD_NAME",
"LAB_CAPTION_NO", "LAB_FONT_NAME", "LAB_COLOR", "LAB_BG_COLOR",
"FLD_FONT_NAME", "FLD_COLOR", "FLD_BG_COLOR", "FLD_WIDTH",
"FLD_EDIT_MASK_NO", "FONT_SIZE")
VALUES (38,'fAssets','assetGroupNoLUFld',18,'MS Sans
Serif','$00000000','$00E0DFE3','MS Sans
Serif','$00000000','$00FFFFFF',100,1,10);


INSERT INTO "FIELDS" ("FIELD_REC_NO", "FORM_NAME", "FIELD_NAME",
"LAB_CAPTION_NO", "LAB_FONT_NAME", "LAB_COLOR", "LAB_BG_COLOR",
"FLD_FONT_NAME", "FLD_COLOR", "FLD_BG_COLOR", "FLD_WIDTH",
"FLD_EDIT_MASK_NO", "FONT_SIZE")
VALUES (39,'fAssets','assetManufacturerNoLUFld',19,'MS Sans
Serif','$00000000','$00E0DFE3','MS Sans
Serif','$00000000','$00FFFFFF',100,1,10);


INSERT INTO "FIELDS" ("FIELD_REC_NO", "FORM_NAME", "FIELD_NAME",
"LAB_CAPTION_NO", "LAB_FONT_NAME", "LAB_COLOR", "LAB_BG_COLOR",
"FLD_FONT_NAME", "FLD_COLOR", "FLD_BG_COLOR", "FLD_WIDTH",
"FLD_EDIT_MASK_NO", "FONT_SIZE")
VALUES (40,'fAssets','assetVendorNoLUFld',20,'MS Sans
Serif','$00000000','$00E0DFE3','MS Sans
Serif','$00000000','$00FFFFFF',100,1,10);


INSERT INTO "FIELDS" ("FIELD_REC_NO", "FORM_NAME", "FIELD_NAME",
"LAB_CAPTION_NO", "LAB_FONT_NAME", "LAB_COLOR", "LAB_BG_COLOR",
"FLD_FONT_NAME", "FLD_COLOR", "FLD_BG_COLOR", "FLD_WIDTH",
"FLD_EDIT_MASK_NO", "FONT_SIZE")
VALUES (41,'fAssets','assetPurchaseAmountFld',21,'MS Sans
Serif','$00000000','$00E0DFE3','MS Sans
Serif','$00000000','$00FFFFFF',100,1,10);


INSERT INTO "FIELDS" ("FIELD_REC_NO", "FORM_NAME", "FIELD_NAME",
"LAB_CAPTION_NO", "LAB_FONT_NAME", "LAB_COLOR", "LAB_BG_COLOR",
"FLD_FONT_NAME", "FLD_COLOR", "FLD_BG_COLOR", "FLD_WIDTH",
"FLD_EDIT_MASK_NO", "FONT_SIZE")
VALUES (42,'fAssets','assetPurchaseDateFld',22,'MS Sans
Serif','$00000000','$00E0DFE3','MS Sans
Serif','$00000000','$00FFFFFF',100,1,10);


INSERT INTO "FIELDS" ("FIELD_REC_NO", "FORM_NAME", "FIELD_NAME",
"LAB_CAPTION_NO", "LAB_FONT_NAME", "LAB_COLOR", "LAB_BG_COLOR",
"FLD_FONT_NAME", "FLD_COLOR", "FLD_BG_COLOR", "FLD_WIDTH",
"FLD_EDIT_MASK_NO", "FONT_SIZE")
VALUES (43,'fAssets','assetLifeSpanFld',23,'MS Sans
Serif','$00000000','$00E0DFE3','MS Sans
Serif','$00000000','$00FFFFFF',100,1,10);


INSERT INTO "FIELDS" ("FIELD_REC_NO", "FORM_NAME", "FIELD_NAME",
"LAB_CAPTION_NO", "LAB_FONT_NAME", "LAB_COLOR", "LAB_BG_COLOR",
"FLD_FONT_NAME", "FLD_COLOR", "FLD_BG_COLOR", "FLD_WIDTH",
"FLD_EDIT_MASK_NO", "FONT_SIZE")
VALUES (44,'fAssets','assetBreakEvenPointFld',24,'MS Sans
Serif','$00000000','$00E0DFE3','MS Sans
Serif','$00000000','$00FFFFFF',100,1,10);


INSERT INTO "FIELDS" ("FIELD_REC_NO", "FORM_NAME", "FIELD_NAME",
"LAB_CAPTION_NO", "LAB_FONT_NAME", "LAB_COLOR", "LAB_BG_COLOR",
"FLD_FONT_NAME", "FLD_COLOR", "FLD_BG_COLOR", "FLD_WIDTH",
"FLD_EDIT_MASK_NO", "FONT_SIZE")
VALUES (45,'fAssets','assetImageFld',25,'MS Sans
Serif','$00000000','$00E0DFE3','MS Sans
Serif','$00000000','$00FFFFFF',100,1,10);


INSERT INTO "FIELDS" ("FIELD_REC_NO", "FORM_NAME", "FIELD_NAME",
"LAB_CAPTION_NO", "LAB_FONT_NAME", "LAB_COLOR", "LAB_BG_COLOR",
"FLD_FONT_NAME", "FLD_COLOR", "FLD_BG_COLOR", "FLD_WIDTH",
"FLD_EDIT_MASK_NO", "FONT_SIZE")
VALUES (46,'fAssets','assetNoteFld',26,'MS Sans
Serif','$00000000','$00E0DFE3','MS Sans
Serif','$00000000','$00FFFFFF',100,1,10);


INSERT INTO "FIELDS" ("FIELD_REC_NO", "FORM_NAME", "FIELD_NAME",
"LAB_CAPTION_NO", "LAB_FONT_NAME", "LAB_COLOR", "LAB_BG_COLOR",
"FLD_FONT_NAME", "FLD_COLOR", "FLD_BG_COLOR", "FLD_WIDTH",
"FLD_EDIT_MASK_NO", "FONT_SIZE")
VALUES (47,'fAssets','assetTraitsFld',27,'MS Sans
Serif','$00000000','$00E0DFE3','MS Sans
Serif','$00000000','$00FFFFFF',100,1,10);


INSERT INTO "ASSETS" ("ASSET_REC_NO", "ASSET_ID", "ASSET_DESCRIPTION",
"ASSET_TYPE_NO", "ASSET_GROUP_NO", "ASSET_MANUFACTURER_NO",
"ASSET_VENDOR_NO", "ASSET_PURCHASE_AMOUNT", "ASSET_PURCHASE_DATE",
"ASSET_LIFE_SPAN_DAYS", "ASSET_BREAK_EVEN_COST", "ASSET_NOTES",
"ASSET_IMAGE")
VALUES
(23,'test',Null,0,0,0,0,0,'02/15/2007',0,100,Null,'images/noImage.jpg');



The query used is...

select FORM_NAME,FIELD_NAME,LABEL_NAME, LAB_FONT_NAME, LAB_COLOR,
LAB_BG_COLOR, FLD_FONT_NAME, FLD_COLOR, FLD_BG_COLOR,FLD_WIDTH,
FONT_SIZE
from FIELDS, LABELS
where LAB_CAPTION_NO=LABEL_REC_NO

this query is used during the application startup in a TIBQUERY
component to change the labels of the various form items.



[Non-text portions of this message have been removed]