Support forum of the software localization tool Sisulizer


Localization Tool for VB, Delphi, .NET, C#, VB.NET, XML, Online Help, HTML ... Home

Get in contact with the makers of Sisulizer.
Our forum is open for all questions around Sisulizer from customers and prospects.
Don't hesitate to register and ask. The Sisulizer team will answer ASAP.

Search     Help Home Sisulizer Website Download
Search by username
Not logged in - Login | Register 

 Moderated by: Renate.Reinartz, Markus.Kreisel, Jaakko.Salmenius, Ilkka.Salmenius
New Topic Reply Printer Friendly
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 ...
AuthorPost
 Posted: Tue Sep 18th, 2007 12:18 pm
PM Quote Reply
MagicFX
Member
 

Joined: Sat Dec 23rd, 2006
Location: Taipei, Taiwan
Posts: 150
Status: 
Offline
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)

Back To Top PM Quote Reply

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?



WowUltra 1.11 Copyright © 2007 by Jim Hale - Based on WowBB Copyright © 2003-2006 Aycan Gulez

Sisulizer software localization tool - Three simple steps to localize