|
|||
| Moderated by: Renate.Reinartz, Markus.Kreisel, Jaakko.Salmenius, Ilkka.Salmenius |
|
|||||||||||||
| Index or foreign key? - Usage - Three simple steps to localize - Technical Support (You need to be registered at the forum to write) - Localization Tool for VB, Delphi, .NET, C#, VB.NET, XML, Online Help, HTML ... | ||||||||||||||
| Author | Post | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
||||||||||||||
|
MagicFX Member
|
I use sisulizer sample sql to construct the foilowng tables and added some constrains. An question is: the resourceid field became an index field, not a foreign key referred to id field of resource table. Why? ------------------------- USE pcadv; DROP TABLE Resource; DROP TABLE Country; CREATE TABLE Resource ( Id INTEGER NOT NULL, Comment VARCHAR(50), PRIMARY KEY(Id) ); CREATE TABLE Country ( RowId INTEGER NOT NULL, ResourceId INTEGER NOT NULL, Language VARCHAR(10) NOT NULL, Name VARCHAR(50) NOT NULL, Population INTEGER NOT NULL, Capital VARCHAR(50) NOT NULL, Description VARCHAR(200) NOT NULL, PRIMARY KEY(RowId), FOREIGN KEY(ResourceId) REFERENCES Resource(Id) ); /* This stored procedure is optional. Byt default Sisulizer uses this algorithm to get new row id */ CREATE PROCEDURE GetNewId RETURNS (rowId INTEGER) AS BEGIN SELECT MAX(RowId) + 1 FROM Country INTO :rowId; END; INSERT INTO Resource VALUES('0', 'USA'); INSERT INTO Resource VALUES('1', 'Germany'); INSERT INTO Resource VALUES('2', 'Japan'); INSERT INTO Country VALUES('0', '0', 'en', 'United States', 297, 'Washington, D.C.', 'The United States of America is a federal republic of 50 states, located primary on central North America.'); INSERT INTO Country VALUES('1', '1', 'en', 'Germany', 82, 'Berlin', 'Germany or the Federal Republic of Germany is one of the world''s leading industrialized countries, located in the heart of Europe.'); INSERT INTO Country VALUES('2', '2', 'en', 'Japan', 127, 'Tokyo', 'Japan is a country on the western edge of the Pacific Ocean.'); Attachment: indexorfk.png (Downloaded 6 times)
|
|||||||||||||
| ||||||||||||||
| Current time is 10:43 am | |
| Localization Tool for VB, Delphi, .NET, C#, VB.NET, XML, Online Help, HTML ... > Technical Support (You need to be registered at the forum to write) > Usage - Three simple steps to localize > Index or foreign key? | |
Sisulizer software localization tool - Three simple steps to localize