Saturday, October 30, 2010

How to implement nested querey in INFORMATICA

Based on the syntax, I am assuming that you picked this code up from a pl/sql code block and trying to reuse this in Informatica.

While you can use the exact query in the source qualifier (after removing the "INTO " clause), I'd suggest you rewrite the same as follows for the query to be more efficient ,let the code speak for itself and to avoid so many references of the same table.

Select max(nvl(a.RATING,'NULL')) keep
(DENSE_RANK FIRST ORDER BY W_UPDATE_DT desc,
INSPECTION_DATE_WID desc) rating from W_MBS_AM_BLDG_INSP_HDR_F
where PROJECT_WID = vPROJECT_WID;

@Nick,

If they are interested in seeing the latest rating based on a given project very frequently, then a view would make sense. Hopefully that is what you meant....
Otherwise, creating a view just for this one case and that too without the project_wid in the view statement would be far less useful.

No comments:

Post a Comment