On Apr 25, 2008, at 4:20 PM, juju wrote:

>
> If this is the relation with its constraints:
>
> CREATE TABLE Orders
> (o_num INTEGER NOT NULL PRIMARY KEY,
> c_num INTEGER NOT NULL,
> s_num INTEGER DEFAULT 0 NOT NULL,
> o_date DATE NOT NULL,
> o_filled o_filled,
> CONSTRAINT fk_cnum FOREIGN KEY (c_num) REFERENCES Customers (c_num)
>  ON UPDATE CASCADE
>  ON DELETE CASCADE);
>
> Where do I put the domain def:
>
> CREATE DOMAIN o_filled AS VARCHAR (5)
>  DEFAULT 'false'
>  CHECK (VALUE= 'true' OR VALUE='false');
>
> if I try to created the domain thingy separate i get an error about an
> empy string.  If how does the relation reference it (domain) as a
> constraint?


we have a construct called DDL() that might be able to help here.    
Although the specific SQL for the "o_filled" column within the table,  
we dont support that in a nice way at this time....perhaps creating a  
custom TypeEngine subclass would do it.  The docs have examples of  
custom TypeEngines.  The CREATE DOMAIN SQL, you can definitely issue  
that separately beforehand; we have unit tests which do it.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to