#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2004
    Posts
    4
    Rep Power
    0

    Question Views and domains


    Hello good people!

    Here I am with another (probably) silly situation:

    I know that when you create a column on a table without referencing an existing user created domain, one is automatically generated by the system (named like RDB$nnn) and used in that column - OK. I've created all domains i needed for my tables and went fine up to that point.

    The problem is here now: when I created a view, I noticed that the columns referencing directly a table column inherit its domain, but the ones going through functions (UDF, CASE or whatever) get a system generated domain, and I can't use a Cast .. as some_user_domain.

    I wanted to know if that behavior is by design or there is a way to make it inherit or accept a specific domain in this situation.

    Thanks in advance, even if only for your patience reading this
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2003
    Posts
    250
    Rep Power
    15
    Hi,


    I'd say that it doesn't really matter in a VIEW column inherits the DOMAIN datatype.

    Anyway, a column that goes through a function (albeit an UDF or CASE or whatever) isn't the same as the domain anymore (a CASE can change a NUMERIC datatype to a VARCHAR, for instance). So it makes sense.

    --

    With regards,

    Martijn Tonies
    Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL Server.
    Upscene Productions
    http://www.upscene.com
    Martijn Tonies
    Database Workbench: developer IDE for Firebird, MySQL, InterBase, MSSQL Server and Oracle
    Upscene Productions
    http://www.upscene.com
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2004
    Posts
    4
    Rep Power
    0
    Thanks for your reply

    My concern wasn't about changing the domain, but the creation of too many system domains (they weren't reused in any of my tests). I don't know if it is a problem or not but, in a database with, let's say, hundreds of views and stored procedures you will end up with a lot of system domains. Of course, this might be pretty usual in the Firebird world and my worries just nonsense of a begginer, wich i really am

    Best regards
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2003
    Posts
    250
    Rep Power
    15
    >this might be pretty usual in the Firebird world

    It is

    I really wouldn't worry about those...

    --

    With regards,

    Martijn Tonies
    Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL Server.
    Upscene Productions
    http://www.upscene.com
    Martijn Tonies
    Database Workbench: developer IDE for Firebird, MySQL, InterBase, MSSQL Server and Oracle
    Upscene Productions
    http://www.upscene.com

IMN logo majestic logo threadwatch logo seochat tools logo