datawindow not seeing aliased columns in SQL statement

Below is a stripped down version of our SQL statement. The problem is the 2
columns from aliased tables:
"ST_FORGN_CNTRY_CD_TBL_A"."ABBR" and "ST_FORGN_CNTRY_CD_TBL_B"."ABBR".  The
SQL works absolutely fine when I execute within Oracle's SQL*Plus, so I know
the SQL isn't the problem.  The problem is that the datawindow does not seem
to be distinguishing between the 2 columns (it replaces the table alias with
the table's real name).  By doing this, we are not getting the real value
for one of the 2 columns.  The columns we can select from when drawing the
datawindow including 2 entries for "ST_FORGN_CNTRY_CD_TBL"."ABBR" (the real
table) and none for "ST_FORGN_CNTRY_CD_TBL_A"."ABBR" or
"ST_FORGN_CNTRY_CD_TBL_B"."ABBR" (the aliased table columns).  Is there a
reason for this, and more importantly a way to get both values?  Thanks for
any help!

Jeremy Pinkham
Software Engineer
ManTech Advanced Systems International

SELECT "MMRG_TBL"."SFN",
                "MRRG_TBL"."GRM_LST_NME",
                "MRRG_TBL"."GRM_FRST_NME",
                "MRRG_TBL"."GRM_MIDD_NME",
                "MRRG_TBL"."BRD_LST_NME",
                "MRRG_TBL"."BRD_FRST_NME",
                "MRRG_TBL"."BRD_MIDD_NME",
                "MRRG_TBL"."BRD_ST_RES",
                "ST_FORGN_CNTRY_CD_TBL_A"."ABBR",
                "ST_FORGN_CNTRY_CD_TBL_B"."ABBR",
FROM "MRRG_TBL",
            "ST_FORGN_CNTRY_CD_TBL" "ST_FORGN_CNTRY_CD_TBL_A",
            "ST_FORGN_CNTRY_CD_TBL" "ST_FORGN_CNTRY_CD_TBL_B"
WHERE ( mrrg_tbl.grm_st_res = ST_FORGN_CNTRY_CD_TBL_A.nme (+)) and
                ( mrrg_tbl.brd_st_res = ST_FORGN_CNTRY_CD_TBL_B.nme (+)) and
                ( "MRRG_TBL"."RES_RPT_INCLD_FL" = 'Y' ) AND
                ( "MRRG_TBL"."DT_MRRG" >= :arg_from_date ) AND
                ( "MRRG_TBL"."DT_MRRG" <= :arg_to_date ) AND
                ( ( "MRRG_TBL"."GRM_RES_GEO_CD" = :arg_geo_cd
                    AND MRRG_TBL"."GRM_ST_RES"=:arg_state_name ) OR
                    ( "MRRG_TBL"."BRD_RES_GEO_CD" = :arg_geo_cd AND
"MRRG_TBL"."BRD_ST_RES" = :arg_state_name )
                 )
ORDER BY "MRRG_TBL"."DT_MRRG" ASC


0
Jeremy
8/17/1999 4:14:43 PM
sybase.powerbuilder.datawindow 28057 articles. 4 followers. Follow

0 Replies
234 Views

Similar Articles

[PageSpeed] 3

Reply: