logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

Re: refactoring and SQL question: msg#00208

Subject: Re: refactoring and SQL question
I had the feeling - ok thanks, I'll get the parser to work around it. Just for the record, can you confirm if in the following syntax

CREATE TABLE IF NOT EXISTS foo (...)

the 'IF NOT EXISTS' is mysql-only?

cheers

demian.

Tobias Kuckuck wrote:
Hi Demian,

as far as I know this syntax isn't supported by Oracle. Until now I didn't find a way for defining indexes within the create table statement. I think this is only possible for unique indexes, since they are treated as constraints.


CU,

    Tobias

currently indexes are added separately from table definitions, ie

create index item_item_type_fk on item
(
   item_type_id
);

instead of

create table if not exists item
(
item_id int not null,
   category_id                    int,
   -- blah blah ---
   primary key (item_id)
   KEY item_item_type_fk (item)
);

Is there any distinct advantage to keeping it this way? Incorporating keys in table definitions would simplify SQL parsing.

cheers


--
Demian Turner
Programmer
Awarez Limited

Kirkman House, 12-14 Whitfield Street London W1T 2RF
T: +44 (0) 7299 7374   F: +44 (0) 7299 7371


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/


<Prev in Thread] Current Thread [Next in Thread>