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

    Join Date
    Sep 2009
    Posts
    67
    Rep Power
    6

    Table column contraint


    I have a META table that contains an ALIAS field which allows for translation of a given fieldname in a CSV to map to a column name in another table (MAPPING).
    eg. SECTION NAME ALIAS
    A AAA AAAAAA
    A BBB BBBBBB
    A CCC AAAAAA
    That means
    if a field with name AAA is read it maps to column AAAAAA in the MAPPING table
    if a field with name BBB is read it maps to column BBBBBB in the MAPPING table
    if a field with name CCC is read it maps to column AAAAAA in the MAPPING table

    What I want to know is :
    Is it possible to put a constraint on the META table that the ALIAS column value MUST be a column already present in the MAPPING table.
    Thanks
  2. #2
  3. SQL Consultant
    Devshed Supreme Being (6500+ posts)

    Join Date
    Feb 2003
    Location
    Toronto Canada
    Posts
    27,349
    Rep Power
    4281
    you can only reference it to a UNIQUE or PRIMARY key
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2014
    Posts
    10
    Rep Power
    0
    Originally post by r937.
    you can only reference it to a UNIQUE or PRIMARY key
    I am 100% agree with r937.

IMN logo majestic logo threadwatch logo seochat tools logo