Hmm, seems to me I remember discussing this in the past.

I would not try to create primary/foreign key relationships in temp tables 
because the chief reason for them is data integrity, and you have no need of 
that in temporary tables.    At least that is my opinion.  Somebody is sure to 
differ with me but that is OK.

Indexes work just fine to enhance processing, but you can enforce correct 
relationships in your processing code..

Dennis McGrath
Software Developer
QMI Security Solutions
1661 Glenlake Ave
Itasca IL 60143
630-980-8461
[email protected]
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Bruce A. Chitiea
Sent: Wednesday, July 03, 2013 2:23 PM
To: RBASE-L Mailing List
Subject: [RBASE-L] - Re: Error 2801: Reference table does not exist


Error 2801:
1. In Designer;
2. After Pack/Reload
3. After Disconnect/Shutdown/Restart
4. In Designer again
5. Replace the PROJECT command with CREATE TEMPORARY TABLE for TransTest

********************
Here's the UNLOADed structure of the referenced table:

CREATE TABLE `glCode`  +
(`glCodeID` INTEGER  NOT NULL ,  +
 `glCodeParent` TEXT    (4) ,  +
 `glCode` TEXT    (4) NOT NULL ,  +
 `glDesc` TEXT    (20) ,  +
 `glSort` INTEGER  )

ALTER TABLE `glCode` ADD PRIMARY KEY  (`glCodeID` )
AUTONUM `glCodeID` IN `glCode` USING 10041. 1. NONUM

********************
... and the UNLOADED structure of the FKEY-host-to-be table:

CREATE TEMPORARY TABLE `TransTest2`  +
(`transid` INTEGER  NOT NULL  +
('Value for transid cannot be null.') ,  +
 `transdate` DATE     ,  +
 `glCode` TEXT    (4) ,  +
 `transcode` TEXT    (1) ,  +
 `transtype` TEXT    (3) ,  +
 `transnum` TEXT    (12) ,  +
 `vendorid` INTEGER  ,  +
 `transmemo` TEXT    (40) ,  +
 `ExpAmt` CURRENCY ,  +
 `IncAmt` CURRENCY ,  +
 `glCodeID` INTEGER  )

ALTER TABLE `TransTest2` ADD PRIMARY KEY  (`transid` )

********************
If there's something to see, I'm just not seeing it. Thoughts?

Bruce


Reply via email to