Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Creating Table as select...
Richard Foote wrote:
> "Daniel Morgan" <damorgan_at_x.washington.edu> wrote in message
> news:1076372192.932013_at_yasure...
>
>>As Jonathan points out your can and the syntax is documented both by >>Jonathan and at http://tahiti.oracle.com. That said I would like to >>discourage you from doing so. >> >>The reason is that schema objects change. And when people write a single >>create table statement with primary key, unique constraints, foreign key >>constraints, and check constraints they get something that is not >>maintainable. It is always better to CREATE TABLE and then user ALTER >>TABLE to implement the constraints. Keep in mind there is more you want >>to do than just specify the USING INDEX clause ... you may want >>DEFERABLE or other options. And why drop the table just to change a >>constraint.
You don't: It was, as you said, very late. I always think in terms of scripting in development, moving the script to test and then to production.
What I don't like is that if the DBA wants to change something they are fiddling with the code for a table and multiple constraints rather than just modifying a single DDL statement: More chance for error. Just like in most post. ;-)
-- Daniel Morgan http://www.outreach.washington.edu/ext/certificates/oad/oad_crs.asp http://www.outreach.washington.edu/ext/certificates/aoa/aoa_crs.asp damorgan_at_x.washington.edu (replace 'x' with a 'u' to reply)Received on Tue Feb 10 2004 - 08:59:13 CST
![]() |
![]() |