Firebird SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesFirebird SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 20th, 2007, 08:15 PM
aditya.yagnik aditya.yagnik is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2007
Posts: 2 aditya.yagnik User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 33 m 34 sec
Reputation Power: 0
Creating a DOMAIN

Hello people,

I am trying to compare Firebird and PostgreSQL dialects as a part of my research project.

PostgreSQL provides Geometric data types such as POINT(X,Y).

And it is not available in case of Firebird.

I am trying to create geometric data types in Firebird as well using DOMAIN.

I would be very thankful if somebody can guide me in creating the DOMAIN for a POINT(float x, float y).

Thank you all.

Sincerely,
Adi.

Reply With Quote
  #2  
Old January 21st, 2007, 01:44 AM
pabloj's Avatar
pabloj pabloj is offline
Modding: Oracle MsSQL Firebird
Dev Shed God 6th Plane (7500 - 7999 posts)
 
Join Date: Jun 2001
Location: Outside US
Posts: 7,917 pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 2 Months 3 Weeks 3 Days 14 h 16 m 7 sec
Reputation Power: 279
I don't think a DOMAIN would work for that.
Firebird support array datatypes which should do the trick but I'm not shure if those are fully available from SQL.
Anyway GIS support is more on functions like distance() and so on than datatypes, at least for a first rough support usable in web applications, why don't you give them a spin?

Reply With Quote
  #3  
Old January 21st, 2007, 05:43 AM
upscene upscene is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 223 upscene User rank is Corporal (100 - 500 Reputation Level)upscene User rank is Corporal (100 - 500 Reputation Level)upscene User rank is Corporal (100 - 500 Reputation Level)upscene User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 7 h 14 m 50 sec
Reputation Power: 8
DOMAINs are sub-types of existing datatypes. This means that you can never create a complex type as a POINT(x, y).

What you could do, is create a domain POINT that is a "varchar" according to a specific format, by using a CHECK constraint on the domain. You would then have to create an external function that checks the format.

Example:
CHECK (1 = my_point_check(VALUE))


Do note, that you cannot use any arithmetic on the values, cause it's a string value.



Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, NexusDB, Oracle & MS SQL Server
Upscene Productions
http://www.upscene.com
My thoughts:
http://blog.upscene.com/martijn/
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com
Comments on this post
pabloj agrees!

Reply With Quote
  #4  
Old January 21st, 2007, 07:01 PM
aditya.yagnik aditya.yagnik is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2007
Posts: 2 aditya.yagnik User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 33 m 34 sec
Reputation Power: 0
Noted.

Thank you very much guys... really appreciate it...

Sincerely,
Adi.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesFirebird SQL Development > Creating a DOMAIN


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT