Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

help on - convert ansi sql to oracle sql

645859May 13 2009 — edited May 13 2009
hi gurus,

i'm try'g to convert ansi sql to oracle sql.
but i'm getting an error. can u please let me know, if i can convert it or is it better to use ansi sql!
original code in ansi format::
select distinct bfc.NBR_SEQ, bfc.IDN_ENTITY, bfc.CDE_TYPE_ENTITY, n.CDE_STATUS,
         gec.idn_group as idn_parent_id, bfc.IDN_FUNC_BUSS,
         case when bfc.CDE_TYPE_ENTITY = 'P'  OR bfc.CDE_TYPE_ENTITY = 'A' then
            PKG_FW_NVGTR.GET_NAM_PAGE(bfc.IDN_ENTITY)
          else
            PKG_FW_NVGTR.GET_NAM_GROUP(bfc.IDN_ENTITY)
         end as ENTITY_NAM,
         p.Category, p.Display_Txt, p.show_in_nav, p.page_uri
  from
    T_BUSS_FUNC_ENTITY_CREF bfc
    inner join t_buss_func bf on bfc.idn_func_buss = bf.idn_func_buss
    inner join t_entity_prog_cref epc on bfc.idn_entity = epc.idn_entity and bfc.cde_type_entity = epc.cde_type_entity
    left outer join t_page p on bfc.idn_entity = p.idn_page
    left outer join t_group_entity_cref gec on bfc.idn_entity = gec.idn_entity and bfc.cde_type_entity = gec.cde_type_entity
    left outer join t_nvgtr n on bfc.idn_entity = n.idn_entity and bfc.cde_type_entity = n.cde_type_entity
  where
    BF.nam_func_buss = 'CP' AND--P_NAM_FUNC_BUSS and
    epc.cde_program in
      ( select p.cde_program from t_program p where p.nam_program in (
          SELECT * FROM TABLE (CAST(PKG_FW_NVGTR.FN_GET_ARRAY_FROM_COMMA_LIST('LC', ',') AS TYP_ARRAY))))
  order by
    bfc.NBR_SEQ;
tried to convert into oracle
SELECT DISTINCT bfc.NBR_SEQ,
             bfc.IDN_ENTITY,
             bfc.CDE_TYPE_ENTITY,
             n.CDE_STATUS,
             gec.idn_group as idn_parent_id,
             bfc.IDN_FUNC_BUSS,
             case when bfc.CDE_TYPE_ENTITY = 'P'  OR bfc.CDE_TYPE_ENTITY = 'A' then
                         PKG_FW_NVGTR.GET_NAM_PAGE(bfc.IDN_ENTITY)
                       else
                         PKG_FW_NVGTR.GET_NAM_GROUP(bfc.IDN_ENTITY)
             end as ENTITY_NAM,
             p.Category,
             p.Display_Txt,
             p.show_in_nav,
             p.page_uri
FROM    T_BUSS_FUNC_ENTITY_CREF bfc,
             T_BUSS_FUNC bf,
             T_ENTITY_PROG_CREF epc,
             T_PAGE p,
             T_GROUP_ENTITY_CREF gec,
             T_NVGTR n
WHERE bfc.IDN_FUNC_BUSS = bf.IDN_FUNC_BUSS
AND bfc.IDN_ENTITY = epc.IDN_ENTITY
AND bfc.CDE_TYPE_ENTITY = epc.CDE_TYPE_ENTITY
AND bfc.IDN_ENTITY(+) = p.IDN_PAGE
AND bfc.IDN_ENTITY(+) = gec.IDN_ENTITY
AND bfc.CDE_TYPE_ENTITY(+) = gec.CDE_TYPE_ENTITY
AND bfc.IDN_ENTITY(+) = n.IDN_ENTITY
AND bfc.CDE_TYPE_ENTITY(+) = n.CDE_TYPE_ENTITY
AND BF.nam_func_buss = 'CP' AND--P_NAM_FUNC_BUSS and
    epc.cde_program in
      ( select p.cde_program from t_program p where p.nam_program in (
          SELECT * FROM TABLE (CAST(PKG_FW_NVGTR.FN_GET_ARRAY_FROM_COMMA_LIST('LC', ',') AS TYP_ARRAY))))
               order by
                 bfc.NBR_SEQ;
error is
ORA-01417: a table may be outer joined to at most one other table
so how can i convert it?

thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 10 2009
Added on May 13 2009
15 comments
784 views