Subject | RE: [ib-support] Metadata |
---|---|
Author | Cassandra Harley |
Post date | 2003-02-12T02:43:15Z |
>That's really jumping into the freezing pool. I would probably playAbsolutely, these were my intentions.
>around with metadata,ddl,sql what ever you want to in a tool's sql
>editor. I am not familiar with IBAdmin but it should have one.
>Once you get things going then jump into using C++ and etc.
I have started writing a DDL file (see below, comments appreciated).
I will play with it in IBConsole (and Isql).
Is there a way of playing comments into a DDL file? (Is file the correct
term?)
Thanks,
Cassandra
/************** My First attempt below *********/
CREATE DOMAIN D_Address AS CHAR(38) NOT NULL;
CREATE DOMAIN D_ABN AS INTEGER(11) NOT NULL;
CREATE DOMAIN D_Branch AS INTEGER(3) DEFAULT 001 NOT NULL;
CREATE DOMAIN D_Name AS CHAR(200);
CREATE DOMAIN D_Town AS CHAR(27) NOT NULL;
CREATE DOMAIN D_State AS CHAR(3) NOT NULL
CHECK (VALUE IN ('ACT', 'NSW', 'NT', 'QLD', 'SA', 'VIC', 'WA', 'TAS',
'OTH'));
CREATE DOMAIN D_Postcode AS INTEGER(4) NOT NULL
CHECK ((VALUE > 0) AND (VALUE <= 9999));
CREATE DOMAIN D_Country AS CHAR(20);
CREATE DOMAIN D_Contact AS CHAR(20);
CREATE DOMAIN D_Phone AS INTEGER(15);
CREATE DOMAIN D_TFN AS INTEGER(9) NOT NULL;
CREATE DOMAIN D_DATE AS DATE;
CREATE DOMAIN D_Surname AS CHAR(30) NOT NULL;
CREATE DOMAIN D_Given AS CHAR(15);
CREATE DOMAIN D_Memo AS CHAR(500);
CREATE DOMAIN D_Monetary AS DECIMAL(10,2);
CREATE DOMAIN D_ID AS INTEGER(999999);
CREATE TABLE T_Employee
(C_Employee_ID D_ID,
C_Employer_ID D_ID,
C_TFN D_TFN,
C_DOB D_DOB,
C_Surname D_Surname,
C_Firstname D_Given,
C_Secondname D_Given,
C_Address1 D_Address,
C_Address2 D_Address,
C_Town D_Town,
C_State D_State,
C_Postcode D_Postcode,
C_Country D_Country,
PRIMARY KEY (C_Employee_ID),
FOREIGN KEY (C_Employer_ID) REFERENCES (T_Employer_ID)
ON UPDATE CASCADE
ON DELETE CASCADE);
COMMIT;