If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Informix > Mapping View columns to Table columns

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-03-04, 13:42
fprose fprose is offline
Registered User
 
Join Date: Apr 2003
Location: Phoenix, AZ
Posts: 177
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
Reply With Quote
  #2 (permalink)  
Old 06-03-04, 15:55
WiccaChic WiccaChic is offline
Registered User
 
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'))
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On