Ingres Community Forums Login Register Ingres.com  

Ingres Community Forum


Go Back   Ingres Community Forums > Ingres Forums > DBA Forum
 

Reply
 
LinkBack Thread Tools Display Modes
Old 2009-01-06   #1 (permalink)
Junior Member
 
Join Date: Mar 2007
Location: Russia
Posts: 23
Question Domains in Ingres

Hello colleagues!
Please tell me how can I use domains in Ingres sql?
As I know "Create domain" is a standart Transact-SQL operator, but there is nothing about that in Ingres SQL reference guide! Is there any analog?

Last edited by koyott; 2009-01-06 at 12:05 PM.
koyott is offline   Reply With Quote
Old 2009-01-06   #2 (permalink)
Ingres Corp
 
Join Date: Mar 2007
Location: Australia
Posts: 229
Blog Entries: 1
Default

I'm guessing you are talking about the ANSI standard schemas (TSQL probably calls them domains). Ingres supports schemas only in a basic fashion; in Ingres a shcema name is the same as your user name, you can only create tables in the schema that is your current user name (which may be modified either with "-u" flag or wit SET SESSION AUTHORIZATION). created tables may be refference by their schema (e.g. select * from <schema_name>.<table_name>)
stephenb is offline   Reply With Quote
Old 2009-01-06   #3 (permalink)
Junior Member
 
Join Date: Mar 2007
Location: Russia
Posts: 23
Default

I'm talking about how can I control values of attributes in table:
One of control methods is check constraints; other method is to create "domain" for an attribute to check if input values are (or not) agree with that domain. May be I'm confused with an idea?
koyott is offline   Reply With Quote
Old 2009-01-07   #4 (permalink)
Senior Member
 
kschendel's Avatar
 
Join Date: Mar 2007
Location: Pittsburgh, PA
Posts: 912
Default

Ingres does not support domains in the sense of T-SQL. They would essentially translate to a check constraint anyway, so in Ingres, use a check constraint.
kschendel is offline   Reply With Quote
Old 2009-01-07   #5 (permalink)
Ingres Corp
 
Join Date: Mar 2007
Location: Australia
Posts: 229
Blog Entries: 1
Default

Yup, Karl pretty much summed it up....domains are a TSQL specific concept that doesn't exist in other databases, you should use a check constraint instead.
stephenb is offline   Reply With Quote
Old 2009-01-08   #6 (permalink)
Senior Member
 
rhann's Avatar
 
Join Date: Mar 2007
Posts: 188
Default Domains are standard

Quote:
Originally Posted by stephenb View Post
Yup, Karl pretty much summed it up....domains are a TSQL specific concept that doesn't exist in other databases, you should use a check constraint instead.
That is not correct. CREATE DOMAIN and ALTER DOMAIN are both part of standard SQL92. Furthermore, inadequate though the SQL concept of domain is, it still does very much more than a check constraint on an individual column because it harmonizes representations between tables (preventing function attribute joins and other undesirable goofs).

I would very much welcome domain support in Ingres.

I'll get back into my box now. I feel grubby using these [blessed] web-based forums...
__________________
Roy Hann

UK Ingres User Association Conference 2010 will be on Tuesday June 8, 2010
Go to http://www.iua.org.uk/join to get on the mailing list.
rhann is offline   Reply With Quote
Old 2009-01-08   #7 (permalink)
Ingres Corp
 
Join Date: Mar 2007
Location: Australia
Posts: 229
Blog Entries: 1
Default

well I'll be....never noticed that before, it's a good job I'm not on the ANSI committee.

It's the first time someone has mentioned this particular ANSI feature to my knowledge; I wonder how prevalent it is in SQL Server installations. Presumably Oracle has it too.
stephenb is offline   Reply With Quote
Old 2009-01-10   #8 (permalink)
Junior Member
 
Join Date: Mar 2007
Location: Russia
Posts: 23
Thumbs down Domains in Ingres

This is interest to me:
If domains are in SQL92 standart (really, I've just checked), and my Ingres installation supports that standart (option during installation), that's why Ingres must support this SQL92 statement (Create/Alter domain)
But as I see it doesn't??!!

see here:
http://www.ncb.ernet.in/education/mo...075-1-1999.pdf
http://www.iso.org/iso/iso_catalogue...csnumber=16663

Last edited by koyott; 2009-01-10 at 02:53 AM.
koyott is offline   Reply With Quote
Old 2009-01-10   #9 (permalink)
Senior Member
 
kschendel's Avatar
 
Join Date: Mar 2007
Location: Pittsburgh, PA
Posts: 912
Default

Ingres is technically compliant to the "Entry Level" SQL-92 spec only. I don't have the SQL-92 spec in front of me (thank goodness!!!), but I doubt that domains are Entry Level.

I don't mean to blow you off, but domains as they exist in SQL (as far as I know) are a quite limited construct. They are equivalent to a globally defined CHECK constraint, and add little or no value to most business logic constraints. I suppose it would be nice if Ingres supported domains, but it has to be not real high up on the list of things to do to Ingres.
kschendel is offline   Reply With Quote
Old 2009-01-12   #10 (permalink)
Ingres Corp
 
Join Date: Mar 2007
Location: Australia
Posts: 229
Blog Entries: 1
Default

There are several SQL-92 and SQL3 extensions that Ingres doesn't support; I don't think anyone supports everything, with the possible exception of Oracle.

Since this is the first time we're hearing about this particular one, as Karl says, it's not that high on a very long "to-do" list.....of course if anyone would like to code it, we'll be more than happy to accept it back into the code base.
stephenb is offline   Reply With Quote

Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


© 2009 Ingres Corporation. All Rights Reserved