Fill RDB$FIELDS.RDB$COMPUTED_SOURCE for view fields
---------------------------------------------------

                 Key: CORE-6179
                 URL: http://tracker.firebirdsql.org/browse/CORE-6179
             Project: Firebird Core
          Issue Type: Improvement
          Components: Engine
    Affects Versions: 2.5.9, 3.0.4, 3.0.3
            Reporter: Valdir Stiebe Junior
            Priority: Minor


Every RDB$FIELDS.RDB$COMPUTED_SOURCE are null except for the ones from table 
computed fields.
Views with subqueries or expressions as fields should also have the correct 
computed source.

I've found this because I would like to pinpoint fields from views and try to 
execute statement the view source with only selected fields.

This is the sql query I was trying to build.

select
  RF.RDB$FIELD_POSITION,
  coalesce(trim(VR.RDB$CONTEXT_NAME) || '.' || trim(RF.RDB$BASE_FIELD), 
F.RDB$COMPUTED_SOURCE)
from
  RDB$RELATION_FIELDS RF left join
  RDB$VIEW_RELATIONS VR on RF.RDB$RELATION_NAME = VR.RDB$VIEW_NAME and 
RF.RDB$VIEW_CONTEXT = VR.RDB$VIEW_CONTEXT left join
  RDB$FIELDS F on F.RDB$FIELD_NAME = RF.RDB$FIELD_SOURCE
where
  RF.RDB$RELATION_NAME = 'VIEW_NAME'
order by
  RF.RDB$FIELD_POSITION




-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to