Subject RE: [ib-support] Metadata
Author Alan McDonald
Cassandra,
It's much more satisfying to use a tool .. but if you want to give it a go
like this fine...
Integers are Integers, there are no sizes like MYSQL so it's just
CREATE DOMAIN D_ABN AS INTEGER NOT NULL;
in any case. ABN is not an integer either... you'll be caught if it's ever
01 234 456 56
better use VarChar
I would suggest using VarChar for things like names which are variable
length - sure allow 200 max but if it's only 10 long you won't waste space
You have Country... therefore postcode of integer will not work

that's a start
Alan

-----Original Message-----
From: Cassandra Harley [mailto:cass.harley@...]
Sent: Wednesday, 12 February 2003 1:43 PM
To: ib-support@yahoogroups.com
Subject: RE: [ib-support] Metadata



>That's really jumping into the freezing pool. I would probably play
>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.

Absolutely, these were my intentions.
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;



To unsubscribe from this group, send an email to:
ib-support-unsubscribe@egroups.com



Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/