Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2003
    Location
    Phoenix, AZ
    Posts
    177

    Unanswered: Mapping View columns to Table columns

    I need to develop a dictionary or cross reference that maps view/column to table/column. I realize that a view “column” is really an expression and does not necessarily map to a table column – but in our case – they do.

    They only way I can think of doing this is to process the CREATE VIEW statement through AWK and match the first column definition to the first SELECT column, etc.

    Anyone out there have any suggestions or put something like this together?

    Thanks.

    Fred
    Fred Prose

  2. #2
    Join Date
    Jan 2004
    Posts
    71

    partial credit?

    This is incomplete just because I am lazy, but the following will pull a list of views based on the table name specified ni the query. You could use the results of it to match part number to column name in some fasion:

    select tabname,owner,partnum,tabid
    from systables where tabid in
    (select dtabid from sysdepend where btabid in
    (select tabid from systables where tabname = 'sometable'))

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •