Board index » delphi » Select Values from Domain
Iovanut Cristian
Delphi Developer |
Iovanut Cristian
Delphi Developer |
Select Values from Domain2005-06-17 11:21:37 PM delphi235 Hi, I have a domain D_COIN with the values EUR, USD and GBP. I have to select the values from this domain and other domains ? How? 10x Cristian |
Martijn Tonies
Delphi Developer |
2005-06-17 11:35:12 PM
Re:Select Values from DomainQuoteI have a domain -- With regards, Martijn Tonies Database Workbench - tool for InterBase, Firebird, MySQL, Oracle & MS SQL Server Upscene Productions www.upscene.com |
Iovanut Cristian
Delphi Developer |
2005-06-17 11:51:36 PM
Re:Select Values from Domain
Ok. But my question is :
Can I select those values from my defined domain or not . Example : CREATE DOMAIN MONEDA AS VARCHAR(600) CHARACTER SET UNICODE_FSS CHECK (VALUE IN ('EUR', 'USD','GBP')) COLLATE UNICODE_FSS ; I need to write a select statement that returns : EUR USD GBP somthing like select d_moneda from xxxx ..... Is this possible or not ? "Martijn Tonies" <XXXX@XXXXX.COM>writes Quote>I have a domain |
Paul
Delphi Developer |
2005-06-18 12:01:27 AM
Re:Select Values from Domain
"Iovanut Cristian" <XXXX@XXXXX.COM>writes:
QuoteOk. But my question is : ( TheCurrency Moneda, CHECK VALUE(TheCurrency) IN ('EUR', 'USD', 'GBP') ); Not sure of the exact syntax, but that should give you the idea of the difference between a domain and a field and a field value. I think this is closer to what you need. Paul... p.s. Please do NOT toppost. -- plinehan __at__ yahoo __dot__ __com__ XP Pro, SP 2, Oracle, 9.2.0.1.0 (Enterprise Ed.) Interbase 6.0.1.0=6; When asking database related questions, please give other posters some clues, like operating system, version of db being used and DDL. The exact text and/or number of error messages is useful (!= "it didn't work!"). Thanks. Furthermore, As a courtesy to those who spend time analysing and attempting to help, please do not top post. |
Martijn Tonies
Delphi Developer |
2005-06-18 01:36:30 AM
Re:Select Values from DomainQuoteOk. But my question is : these aren't values or anything. -- With regards, Martijn Tonies Database Workbench - tool for InterBase, Firebird, MySQL, Oracle & MS SQL Server Upscene Productions www.upscene.com |
Wayne Niddery [TeamB]
Delphi Developer |
2005-06-19 02:51:49 AM
Re:Select Values from Domain
Iovanut Cristian writes:
QuoteOk. But my question is : id integer not null unique, currency moneda ) Note that hard-coding the check constraint means changing the domain every time you want to add or change a currency code. You would be better off having a table to contain the list of allowable currency codes and then in other tables, use this domain, but have the check constraint in the domain check in the currency table. -- Wayne Niddery - Logic Fundamentals, Inc. (www.logicfundamentals.com) RADBooks: www.logicfundamentals.com/RADBooks.html Light is faster than sound, which is why some folks appear bright before they speak. |
Iovanut Cristian
Delphi Developer |
2005-06-25 08:51:47 PM
Re:Select Values from Domain
This is what I needed :
create domain moneda check value in ...... select rdb$validation_source from RDB$FIELDS where RDB$FIELD_NAME = 'D_MONEDA' "Iovanut Cristian" <XXXX@XXXXX.COM>writes QuoteHi, |