column defined ambiguously

select distinct hp.SYER_PEMBILANG||'/'||hp.SYER_PEMBILANG semua, kp.NAMA kod_pihak_nama,
kb.nama kod_bpm_nama,
kd.NAMA kod_daerah_nama,
kl.NAMA kod_lot_nama,
mo.ID_MOHON ,
ha.NO_LOT,
ha.KOD_HAKMILIK,
ha.NO_HAKMILIK
kd.NAMA kod_daerah_nama
from 
mohon mo,
mohon_pihak mp join kod_pihak kp on (mp.kod_pihak=kp.kod),
hakmilik ha join kod_bpm kb on(ha.kod_bpm=kb.kod)
join kod_daerah kd on(ha.kod_daerah=kd.kod)
join kod_lot kl on (ha.KOD_LOT=kl.kod),
mohon mo join kod_caw kc on(mo.kod_caw=kc.kod),
kod_caw kc join kod_daerah kd on(kc.kod_daerah=kd.kod),
mohon_hakmilik mh,
hakmilik_pihak hp
where
 mp.KOD_PIHAK ='PG'
 and mo.KOD_CAW=kc.KOD
 and kc.KOD_DAERAH=kd.kod
 and mo.id_mohon=:p_id_mohon
 and ha.KOD_BPM=kb.KOD
 and ha.KOD_DAERAH=kd.KOD
 and ha.KOD_LOT=kl.KOD
 and mo.ID_MOHON=mh.ID_MOHON
and mh.id_hakmilik=ha.ID_HAKMILIK
and mo.ID_MOHON=mp.ID_MOHON
and mp.KOD_PIHAK=kp.KOD
and hp.ID_HAKMILIK=ha.ID_HAKMILIK
column defined ambiguously

Published by: user9093689 on November 8, 2010 12:55 AM

Try

Select distinct hp. SYER_PEMBILANG | » /'|| GPA SYER_PEMBILANG semua, kp. AMNA kod_pihak_nama,
KB. NAMA kod_bpm_nama,
KD. AMNA kod_daerah_nama,
LLI AMNA kod_lot_nama,
mo.ID_MOHON,
ha.NO_LOT,
HA. KOD_HAKMILIK,
ha.NO_HAKMILIK,
KD. NAMA kod_daerah_nama_2
Of
Please mo,
mohon_pihak mp,
kod_pihak kp
hakmilik ha,
kod_bpm Ko,
kod_daerah kd,
kod_lot kl,
KC kod_caw,
mohon_hakmilik HD,
HP hakmilik_pihak
where

MP.kod_pihak = KP.kod
and ha.kod_bpm = kb.kod
and ha.kod_daerah = kd.kod
and ha. KOD_LOT = KL.kod
and mo.kod_caw = kc.kod
and kc.kod_daerah = kd.kod
and

MP. KOD_PIHAK = "PG".
and mo. KOD_CAW = kc. KOD
and kc. KOD_DAERAH = KD.kod
and mo.id_mohon =: p_id_mohon
and ha. KOD_BPM = kb. KOD
and ha. KOD_DAERAH = kd. KOD
and ha. KOD_LOT = kl. KOD
and mo.ID_MOHON = mh.ID_MOHON
and mh.id_hakmilik = ha.id_hakmilik
and mo.ID_MOHON = mp.ID_MOHON
and mp. KOD_PIHAK = kp. KOD
and hp.ID_HAKMILIK = ha.ID_HAKMILIK

Tags: Database

Similar Questions

  • UNPIVOT: Column defined Ambiguosuly

    Dear all,

    During the race below set out, I get "column defined Ambiguosuly '...

    Please help me on this...

    [code]

    SELECT *.

    Of

    (

    SELECT activity_type,

    COUNT (decode (CASE WHEN activity_type = 'K' then 1 when activity_type = END 'BH', 1, 1, 1)) vacation,.

    COUNT (decode (CASE WHEN activity_type = 1 then 'SL' where activity_type = '2' then 1 END, 1, 1)) leave.

    Annual Count(case when activity_type = 'AL' Then 1 else null end)

    Count (case when activity_type = 'OL' Then 1 else null end) Other_no,

    Count (case when activity_type = 'IM' Then 1 else null end) InternalMeeting,

    Count (case when activity_type = 'TR' Then 1 else null end) training,

    Office Count (case when activity_type = 'ISM' Then 1 else null end),

    COUNT (decode (CASE WHEN activity_type = "CS" then 1 when activity_type = '10' then 1 when activity_type = END 'customer Service', 1, 1, 1, 1)) ExternalMeeting,.

    Count (case when activity_type = '9' Then 1 else null end) Symposium,

    Count (case when activity_type = '12' Then 1 else null end) Transit,

    The result of the Count (case when activity_type = 'H' Then 1 else null end),

    Count (case when activity_type = '10' Then 1 else null end) CME

    OF planner_activity pa

    WHERE tenant_id = 500020

    GROUP BY activity_type

    )

    UNPIVOT

    (

    monthly_count

    FOR activity_type (HOLIDAYS, ANNUAL LEAVE, OTHER_NO, INTERNALMEETING, TRAINING, OFFICE, EXTERNALMEETING, SYMPOSIUM, TRANSIT, RESULT, CME)

    )


    [/ code]

    I want to make the sum of the result... Please help me...

    Thanks a lot for your help...

    What you do are a little weird: you use the count instructions (box) to transform the data from rows into columns, and then you do a upivot to return the columns in lines.

    I think what you really want to do is the following:

    Select activity_label, count (*)

    Of

    (SELECT activity_type,

    CASE WHEN activity_type in ('K', 'BH') then 'holiday '.

    When in activity_type ('SL', ' 2') and then click "exit".

    WHEN activity_type = 'AL' and 'annual '.

    ...

    end activity_label

    of planner_activity pa

    WHERE tenant_id = 500020

    )

    Activity_label group

  • "a defined column of ambiguous way."

    0 down vote favorite

    Can someone help me please. When I run this code, whenever I get "ambiguously defined column. Can not solve this problem, I can understand the cause of this error.

    SELECT dc.name, COUNT(am.idn), adm.count
    FROM vpdgk.vp_admin am
    INNER JOIN vpdgk.vp_mufettish mf ON am.mufet_id = mf.IDN
    INNER JOIN dictionaries.customs_main dc ON dc.code_int = mf.FIRM
    LEFT JOIN (
    SELECT C.MUFET_ID, d.name name, b.name, COUNT(c.MUFET_ID) count
    FROM vpdgk.vp_qeydiyyat A
    INNER JOIN vpdgk.vp_mufettish b ON b.IDN = A.mufet_id
    INNER JOIN vpdgk.vp_admin c ON c.mufet_id = A.mufet_id
      
    AND (c.uid_ is not null or c.uid_reserv is not null)
    INNER JOIN dictionaries.customs_main d ON d.code_int = b.FIRM
    WHERE TRUNC(A.INSERT_DATE) BETWEEN TO_DATE('01.01.2015','DD.MM.YYYY')
      
    AND TO_DATE('30.01.2015','DD.MM.YYYY')
    GROUP BY C.MUFET_ID, d.name, b.name
    Having COUNT(c.MUFET_ID) < 10) adm
    ON dc.name = adm.name
    GROUP BY dc.name, adm.count;

    Is name d.name, b.name, they are both called name of subquery ADM.

    Do something like this

    SELECT dc.name, COUNT (am.idn), adm.count

    FROM: vpdgk.vp_admin

    INNER JOIN vpdgk.vp_mufettish ON am.mufet_id mf is mf. IDN

    INNER JOIN dictionaries.customs_main ON dc.code_int dc is mf. CABINET

    LEFT JOIN)

    SELECT C.MUFET_ID, name of d.name, Anom b.name, COUNT County (c.MUFET_ID)

    OF vpdgk.vp_qeydiyyat A

    INNER JOIN vpdgk.vp_mufettish b ON b.IDN = A.mufet_id

    INNER JOIN vpdgk.vp_admin c ON c.mufet_id = A.mufet_id

    (C.uid_ is not null and c.uid_reserv is not null)

    INNER JOIN dictionaries.customs_main d.code_int d = b.FIRM

    WHEN TRUNC (A.INSERT_DATE) BETWEEN TO_DATE ('01.01.2015 ',' DD.) MM YYYY')

    AND TO_DATE ('30.01.2015 ',' DD.) MM YYYY')

    GROUP OF C.MUFET_ID, d.name, b.name

    Having COUNT (c.MUFET_ID)< 10)="">

    ON dc.name = adm.name

    Dc.name GROUP, adm.count;

  • Ambigiously column defined

    I receive the error: ORA-20001: get_dbms_sql_cursor error ORA-00918: column ambiguously defined
    But do not understand why it gives me this error because I checked the prefix of columns and they are ok...

    select 
    
    a.CSNCONTACTPERSON, 
    a.FIRSTNAMECONTACTPERSON, 
    a.LASTNAMECONTACTPERSON, 
    a.CHAMBEROFCOMMERCE, 
    a.MOBPHONECONTACTPERSON, 
    b.CHAMBEROFCOMMERCE
    
    from bi_contacts a, bi_relations b
    where a.chamberofcommerce = :P5_CoC
    : P5_CoC contains the value of b.CHAMBEROFCOMMERCE

    Any thoughts on what I am doing wrong?

    TheStudent wrote:
    I receive the error: ORA-20001: get_dbms_sql_cursor error ORA-00918: column ambiguously defined
    But do not understand why it gives me this error because I checked the prefix of columns and they are ok...

    select 
    
    a.CSNCONTACTPERSON,
    a.FIRSTNAMECONTACTPERSON,
    a.LASTNAMECONTACTPERSON,
    a.CHAMBEROFCOMMERCE,
    a.MOBPHONECONTACTPERSON,
    b.CHAMBEROFCOMMERCE
    
    from bi_contacts a, bi_relations b
    where a.chamberofcommerce = :P5_CoC
    

    : P5_CoC contains the value of b.CHAMBEROFCOMMERCE

    Any thoughts on what I am doing wrong?

    You try to use it in a report? If so, APEX will wrap your query inside another to support various features (paging, interactive reports, etc.), this query see 2 CHAMBEROFCOMMERCE columns in the SELECT list. These columns must be particularly well named, so add appropriate aliases for columns:

    select 
    
    a.CSNCONTACTPERSON,
    a.FIRSTNAMECONTACTPERSON,
    a.LASTNAMECONTACTPERSON,
    a.CHAMBEROFCOMMERCE chamber_a,
    a.MOBPHONECONTACTPERSON,
    b.CHAMBEROFCOMMERCE chamber_b
    
    from bi_contacts a, bi_relations b
    where a.chamberofcommerce = :P5_CoC
    

    (Joins/absence looks always doubtful...)

  • ORA - 00918:column defined ambiguosly

    select ha.kod_daerah,kb.nama bpm,kn.nama,pi.NAMA,pi.ALAMAT1,pi.ALAMAT2,pi.ALAMAT3,pi.ALAMAT4,pi.POSKOD,to_char(lp.trh_keluar,'DD') day,
            DECODE (TO_CHAR (lp.trh_keluar, 'MM'),
                   '01', 'JANUARI',
                      '02', 'FEBRUARI',
                      '03', 'MAC',
                      '04', 'APRIL',
                      '05', 'MEI',
                      '06', 'JUN',
                      '07', 'JULAI',
                      '08', 'OGOS',
                      '09', 'SEPTEMBER',
                      '10', 'OKTOBER',
                      '11', 'NOVEMBER',
                      '12', 'DISEMBER'
                     ) month , to_char(lp.trh_keluar,'YYYY') year ,mh.LOKASI,mh.LUAS,mh.NO_PAJAKAN,mh.ID_HAKMILIK
    ,lp.ID_BHN_BATU,lp.KUANTITI_MAX,lp.KOD_UOM_KNTT,lp.KADAR_BYRN,lp.KOD_UOM,lp.PERUNTUKAN_TMBHN,lp.NO_PERMIT,lp.NO_RESIT,lp.BYRN,lp.BYRN_PKATAAN,
    pi.NO_PENGENALAN
    from mohon mo,mohon_hakmilik mh,lupus_permit lp,pemohon pe,pihak pi join kod_negeri kn on (pi.kod_negeri=kn.kod),hakmilik ha join kod_bpm kb on
    (ha.kod_bpm=kb.bpm),hakmilik ha join kod_daerah kd on(ha.kod_daerah=kd.kod)
     where mo.ID_MOHON=mh.ID_MOHON and mo.ID_MOHON=lp.ID_MOHON 
    and  mo.id_mohon=:p_id_mohon and lp.ID_MOHON = pe.ID_MOHON and pe.id_pihak = pi.ID_PIHAK and ha.id_hakmilik=mh.ID_HAKMILIK
    and ha.kod_bpm=kb.bpm and ha.kod_daerah=kd.kod 
    
    error;ora-00918:column ambiguosly defined

    Try Thie below,

    Select ha.kod_daerah,
    KB. NAMA bpm,
    kN.Nama,
    PI. NAMA,
    PI. ALAMAT1,
    PI. ALAMAT2,
    PI. ALAMAT3,
    PI. ALAMAT4,
    PI. POSKOD,
    TO_CHAR (LP.trh_keluar, 'DD') day,
    DECODE (TO_CHAR (lp.trh_keluar, 'MM'),
    '01', 'JANUARY',
    '02', 'FEBRUARY',
    '03', 'MAC ',.
    '04', 'APRIL ',.
    '05', 'MEI ',.
    '06', 'JUNE ',.
    '07', 'JULAÏ ',.
    "08', 'OGOS."
    '09', 'SEPTEMBER',
    '10', 'OCTOBER',
    '11', 'NOVEMBER',
    '12', 'DISEMBER.
    ) months.
    TO_CHAR (LP.trh_keluar, 'YYYY') year,
    HD. MAP,
    HD. LUAS,
    mh.NO_PAJAKAN,
    mh.ID_HAKMILIK
    lp.ID_BHN_BATU,
    LP. KUANTITI_MAX,
    LP. KOD_UOM_KNTT,
    LP. KADAR_BYRN,
    LP. KOD_UOM,
    LP. PERUNTUKAN_TMBHN,
    lp.NO_PERMIT,
    lp.NO_RESIT,
    LP. BYRN,
    LP. BYRN_PKATAAN,
    pi.NO_PENGENALAN
    of please MB.
    mohon_hakmilik HD,
    lupus_permit lp,
    pemohon pe,
    pihak pi join kod_negeri kn on (pi.kod_negeri = kn.kod).
    hakmilik ha kod_bpm Ko on(ha.kod_bpm=kb.bpm) join
    Join kod_daerah kd on(ha.kod_daerah=kd.kod)
    where mo.ID_MOHON = mh.ID_MOHON and
    mo.ID_MOHON = lp.ID_MOHON and
    Mo.id_mohon =: p_id_mohon and
    lp.ID_MOHON = pe.ID_MOHON and
    PE.id_pihak = pi.ID_PIHAK and
    HA.id_hakmilik = MH.id_hakmilik and
    HA.kod_bpm = KB. BPM and
    HA.kod_daerah = KD.kod;

    P. S.) I didn't test this.

    Kind regards
    Florian...

  • Change of shape joining multi tables SQL...

    I need to be able to join the tables in the detail section of my master-detail form. Since I have more than three paintings to join, I think that APEX needs to use "ROWID" to track the value of the key of the primary table. When I try substitute basic sql generated for the report to my own joined table I get an error return "IMPOSSIBLE of ANALYSER. If I remove "ROWID" in the statement, then fine. Here's the statement from the apex generated:

    Select
    "ROWID",.
    "PO_ID."
    "PO_DET_ID,"
    "CHANGE_ORDER,"
    'START_DATE ',.
    'END_DATE ',.
    "PO_DET_AMT,"
    "SCOPE."
    "PO_STATUS,"
    "MRS."
    of ' #OWNER # '. " PO_DETAILS ".
    where "PO_ID" =: P240_PO_ID

    However, I need for the statement as follows:

    Select "ROWID",.
    po_details.po_id,
    po_details.po_det_id,
    po_details.change_order,
    po_details.start_date,
    po_details.end_date,
    po_details.po_det_amt,
    po_details. Scope,
    po_details.po_status,
    po_details. WBS
    of PO_DETAILS, IN., WBS, PROJECT
    where po_details.po_id = po.po_id
    and po.po_number = wbs.po_number_id
    and po_details.wbs = wbs.wbs_number_id
    and substr (wbs.wbs_number_id, 1, 6) = project.wbs_sequence
    and project.project_number = nvl(:F101_FPC_NUMBER,project.project_number)
    and po_details.po_id =: P240_PO_ID

    Then, I get the following ORACLE error:

    •Query cannot be parsed in the generator. If you believe that your query is syntactically correct, check the generic "columns" box below the source of the region without analysis. ORA-00918: column ambiguously defined

    I'm guessing that the column "defined ambiguous ' is ROWID.

    SELECT the query aspect works fine if I remove ROWID, but I then cannot update the table when the user needs to change the data. I get an exception defined by the user.

    I am new to APEX, so I do not know there are certain aspects that I'm missing.
    Any tips?

    There is no way to use a join of multiple tables in the APEX?

    Of course you can. Have you tried again (with the help of PO_DETAILS ROWID in the select statement)?

    I tried with a form on EMP and then modified the query to:

    select
    e."ROWID",
    e."EMPNO",
    e."ENAME",
    e."JOB"
    from "#OWNER#"."EMP" e, dept d
    where e.deptno = d.deptno
    and d.deptno = :P14_DEPTNO
    

    IMHO, it's simply more transparent if you use a view as the source. You select a view, and you update the same point of view.

    Published by: InoL on May 14, 2013 13:49

  • Friday afternoon the fog... brain ambiguously defined columns?

    It is a Friday and I just want to go home because I can not for the life of see me why I get an error of ambiguous column defined here? :

    I associate myself with a main CMD querey which works very well in a small Protocol table downstairs...

    SELECT distinct
    CMD."BI_SRV_LOC_NBR" LIKE Loc1,.
    Protocol. "' BI_SRV_LOC_NBR ' AS Loc2

    Of

    (SELECT DISTINCT
    'BI_SO_MASTER '. "" BI_SO_NBR, "
    'BI_WRKFLW_TASKS '. "" BI_TASK_CD, "
    'BI_WRKFLW_TASKS '. "" BI_WORKGRP, "
    'BI_SO_MASTER '. "" BI_SO_STAT_CD, "
    'BI_WRKFLW_TASKS '. "" BI_WRKFLW_KEY, "
    'BI_WRKFLW_TASKS '. "" BI_WRKFLW_TASKS_KEY, "
    'BI_WRKFLW_TASKS '. "" BI_EVENT_DT_TM, "
    'BI_WRKFLW_TASKS '. "" BI_NEEDED_DT_TM, "
    'BI_SO_TYPE_REF '. "" BI_SO_TYPE_DESC, "
    'BI_WRKFLW_TASKS '. "" BI_CRITICAL_TASK_SW, "
    'BI_SO_MASTER '. "" BI_WO_WORKORD, "
    'BI_WRKFLW_TASKS '. "" BI_WRKFLW_TASK_SEQ_NBR, "
    'BI_TASK_REF '. "" BI_TASK_DESC, "
    'BI_WRKFLW_TASKS '. "" BI_WORK_EVENT_CD, "
    'BI_WRKFLW_TASKS '. "" BI_TASK_RMKS, "
    'BI_WRKFLW '. "" BI_WRKFLW_KEY, "
    'BI_RESOURCE_REF '. "" BI_RESOURCE_NM, "
    'BI_PERSONAL '. "" BI_FORMAT_NAME, "
    'BI_SO_MASTER '. "" BI_SO_FULL_NM, "
    'BI_SO_MASTER '. "" BI_OPEN_DT, "
    'BI_SO_MASTER '. "" BI_CLOSE_DT, "
    'BI_WRKFLW_TASKS '. "" BI_DURATION_DAYS, "
    'BI_WRKFLW '. "" BI_EVENT_DT_TM, "
    'BI_SO_MASTER '. "" BI_SO_DESC, "
    'BI_TYPE_SERVICE '. "" BI_PRIM_RATE_SCHED, "
    'BI_SO_DET_VIEW_1 '. "" BI_SO_TYPE_CD, "
    'BI_SO_DET_VIEW_1 '. "" ACCT_NBR, "
    'BI_SO_DET_VIEW_1 '. "" CUST_NBR, "
    'BI_RDG '. "" BI_DMD_MULT, "
    'BI_RDG '. "" BI_MTR_MULT, "
    'BI_SO_DET_VIEW_1 '. "" BI_MAP_LOC_NBR, "
    'BI_SO_DET_VIEW_1 '. "" BI_SRV_LOC_NBR ".
    Of
    ((("CIS54025". "BI_SO_MASTER" "BI_SO_MASTER"
    LEFT OUTER JOIN
    "xxxxx." ' ' BI_SO_TYPE_REF ' 'BI_SO_TYPE_REF '.
    WE
    'BI_SO_MASTER '. "" BI_SO_TYPE_CD "=" BI_SO_TYPE_REF. " ("' BI_SO_TYPE_CD")
    LEFT OUTER JOIN
    "xxxxx." ' ' BI_SO_DET_VIEW_1 ' 'BI_SO_DET_VIEW_1 '.
    WE
    'BI_SO_MASTER '. "BI_SO_NBR"= "BI_SO_DET_VIEW_1". ("' BI_SO_NBR")
    LEFT OUTER JOIN
    "xxxxx." ' ' BI_WRKFLW ' 'BI_WRKFLW '.
    WE
    'BI_SO_DET_VIEW_1 '. "" BI_WRKFLW_KEY "=" BI_WRKFLW. " ("' BI_WRKFLW_KEY")
    LEFT OUTER JOIN
    "xxxxx." ' ' BI_RDG ' 'BI_RDG '.
    WE
    'BI_SO_DET_VIEW_1 '. "" ACCT_NBR "=" BI_RDG. " ("' BI_ACCT")
    LEFT OUTER JOIN
    "xxxxx." ' ' BI_TYPE_SERVICE ' 'BI_TYPE_SERVICE '.
    WE
    'BI_RDG '. "" BI_ACCT "=" BI_TYPE_SERVICE. " ("' BI_ACCT")
    LEFT OUTER JOIN
    "xxxxx." ' ' BI_AR ' 'BI_AR '.
    WE
    ("BI_TYPE_SERVICE". "" BI_ACCT "=" BI_AR. " ("' BI_ACCT")
    AND ("BI_TYPE_SERVICE". "" BI_TYPE_SRV "=" BI_AR. " (("" BI_TYPE_SRV "))
    LEFT OUTER JOIN
    "xxxxx." ' ' BI_CONSUMER ' 'BI_CONSUMER '.
    WE
    'BI_AR '. "" BI_ACCT "=" BI_CONSUMER. " ("' BI_ACCT")
    LEFT OUTER JOIN
    "xxxxx." ' ' BI_PERSONAL ' 'BI_PERSONAL '.
    WE
    ("BI_CONSUMER". "" BI_PER_ACCT "=" BI_PERSONAL. " ("' BI_ACCT")
    AND ("BI_CONSUMER". "" BI_CUST_NBR "=" BI_PERSONAL. " (("" BI_CUST_NBR "))
    LEFT OUTER JOIN
    "xxxxx." ' ' BI_WRKFLW_TASKS ' 'BI_WRKFLW_TASKS '.
    WE
    'BI_WRKFLW '. "" BI_WRKFLW_KEY "=" BI_WRKFLW_TASKS. " ("' BI_WRKFLW_KEY")
    LEFT OUTER JOIN
    "xxxxx." ' ' BI_TASK_REF ' 'BI_TASK_REF '.
    WE
    'BI_WRKFLW_TASKS '. "" BI_TASK_CD "=" BI_TASK_REF. " ("' BI_TASK_CD")
    LEFT OUTER JOIN
    "xxxxx." ' ' BI_TASK_ASG_SCHED ' 'BI_TASK_ASG_SCHED '.
    WE
    'BI_WRKFLW_TASKS '. "" BI_WRKFLW_TASKS_KEY "=" BI_TASK_ASG_SCHED. " ("' BI_WRKFLW_TASK_KEY")
    LEFT OUTER JOIN
    "xxxxx." ' ' BI_RESOURCE_REF ' 'BI_RESOURCE_REF '.
    WE
    'BI_TASK_ASG_SCHED '. "" BI_RESOURCE_ID "=" BI_RESOURCE_REF. " "" BI_RESOURCE_ID ".
    WHERE
    'BI_WRKFLW_TASKS '. "BI_WORK_EVENT_CD" = "COMP"
    AND ("BI_TYPE_SERVICE". "BI_PRIM_RATE_SCHED"= "001"
    (OR 'BI_TYPE_SERVICE'. "BI_PRIM_RATE_SCHED" = "001NS"
    (OR 'BI_TYPE_SERVICE'. ' BI_PRIM_RATE_SCHED '= '002'
    (OR 'BI_TYPE_SERVICE'. "BI_PRIM_RATE_SCHED"= "010"
    (OR 'BI_TYPE_SERVICE'. "BI_PRIM_RATE_SCHED" = "010NS"
    (OR 'BI_TYPE_SERVICE'. ' BI_PRIM_RATE_SCHED '= '020'
    (OR 'BI_TYPE_SERVICE'. "BI_PRIM_RATE_SCHED" = "020NS"
    (OR 'BI_TYPE_SERVICE'. ' BI_PRIM_RATE_SCHED '= '085'
    (OR 'BI_TYPE_SERVICE'. "BI_PRIM_RATE_SCHED" = "085I"
    (OR 'BI_TYPE_SERVICE'. "BI_PRIM_RATE_SCHED" = "085NS"
    (OR 'BI_TYPE_SERVICE'. "BI_PRIM_RATE_SCHED"= "086"
    (OR 'BI_TYPE_SERVICE'. "BI_PRIM_RATE_SCHED" = "086NS"
    (OR 'BI_TYPE_SERVICE'. "BI_PRIM_RATE_SCHED" = "SRC"
    (OR 'BI_TYPE_SERVICE'. "BI_PRIM_RATE_SCHED" = "RHCNS"
    (OR 'BI_TYPE_SERVICE'. «BI_PRIM_RATE_SCHED "="RHR ""
    (OR 'BI_TYPE_SERVICE'. ("" BI_PRIM_RATE_SCHED "=" RHRNS ")
    AND ("BI_SO_TYPE_REF". "BI_SO_TYPE_DESC" = "end $Billing point"
    AND "BI_TASK_REF". ' BI_TASK_DESC ' = '$Billing reading/Service check.
    (OR 'BI_SO_TYPE_REF'. "BI_SO_TYPE_DESC" = "$Cutoff"
    AND "BI_TASK_REF". "BI_TASK_DESC" = "$déconnexion meter.
    (OR 'BI_SO_TYPE_REF'. «BI_SO_TYPE_DESC "=" $De-energize/Re-energize "»
    AND "BI_TASK_REF". "BI_TASK_DESC" = "$désexcite Service"
    (OR 'BI_SO_TYPE_REF'. «BI_SO_TYPE_DESC "=" $$ disconnect Service»»
    AND "BI_TASK_REF". "BI_TASK_DESC" = "$déconnexion meter.
    (OR 'BI_SO_TYPE_REF'. "BI_SO_TYPE_DESC" = "$Endpoint Service"
    AND "BI_TASK_REF". ' BI_TASK_DESC ' = '$Field in action.
    (OR 'BI_SO_TYPE_REF'. «BI_SO_TYPE_DESC "="$Rate change ""
    AND "BI_TASK_REF". «BI_TASK_DESC ' = ' count$»
    (OR 'BI_SO_TYPE_REF'. «BI_SO_TYPE_DESC "="$nouvelle residence Service»"
    AND "BI_TASK_REF". «BI_TASK_DESC ' = ' count$»
    (OR 'BI_SO_TYPE_REF'. "BI_SO_TYPE_DESC" = "$reconnecter Service"
    AND "BI_TASK_REF". «BI_TASK_DESC ' = ' count$»
    (OR 'BI_SO_TYPE_REF'. «BI_SO_TYPE_DESC "="$Service change ""
    AND "BI_TASK_REF". «BI_TASK_DESC ' = ' count$»
    (OR 'BI_SO_TYPE_REF'. "BI_SO_TYPE_DESC"= "$Svc audits/10 Yr Chg"
    AND "BI_TASK_REF". ' BI_TASK_DESC ' = '$Svc field audit work.
    (OR 'BI_SO_TYPE_REF'. "BI_SO_TYPE_DESC" = "use $Zero Check" point of termination
    AND "BI_TASK_REF". ' BI_TASK_DESC ' = '$Zero use check reading/Svc.
    (OR 'BI_SO_TYPE_REF'. «BI_SO_TYPE_DESC ' = 'verification of use/Svc $Zero»'
    AND "BI_TASK_REF". ("" BI_TASK_DESC "=" use the audit Fld Wrk $Zero ")
    AND ("BI_WRKFLW_TASKS". "" BI_EVENT_DT_TM "> = TO_DATE (1 January 2014 00:01:01 '," HH24:MI:SS DD-MM-YYYY ")
    AND "BI_WRKFLW_TASKS". ("' BI_EVENT_DT_TM" < TO_DATE (January 4, 2014 00:00:00 ', HH24:MI:SS ' DD-MM-YYYY "))
    ) CMD.

    LEFT OUTER JOIN

    (SELECT 'BI_SRV_LOC_NBR' FROM 'BI_SRV_LOC') Protocol

    ON CMD. ' BI_SRV_LOC_NBR '= Protocol. BI_SRV_LOC_NBR ".

    Hello

    In the command line, the next column view, the names are used 2 times each:

    NI_EVENT_DT_TM

    BI_WRKFLW_KEY.

    ... (SELECT DISTINCT

    'BI_SO_MASTER '. "" BI_SO_NBR, "

    'BI_WRKFLW_TASKS '. "" BI_TASK_CD, "

    'BI_WRKFLW_TASKS '. "" BI_WORKGRP, "

    'BI_SO_MASTER '. "" BI_SO_STAT_CD, "

    'BI_WRKFLW_TASKS '. "' BI_WRKFLW_KEY ', - 1

    'BI_WRKFLW_TASKS '. "" BI_WRKFLW_TASKS_KEY, "

    'BI_WRKFLW_TASKS '. "' BI_EVENT_DT_TM ', - 1

    'BI_WRKFLW_TASKS '. "" BI_NEEDED_DT_TM, "

    'BI_SO_TYPE_REF '. "" BI_SO_TYPE_DESC, "

    'BI_WRKFLW_TASKS '. "" BI_CRITICAL_TASK_SW, "

    'BI_SO_MASTER '. "" BI_WO_WORKORD, "

    'BI_WRKFLW_TASKS '. "" BI_WRKFLW_TASK_SEQ_NBR, "

    'BI_TASK_REF '. "" BI_TASK_DESC, "

    'BI_WRKFLW_TASKS '. "" BI_WORK_EVENT_CD, "

    'BI_WRKFLW_TASKS '. "" BI_TASK_RMKS, "

    'BI_WRKFLW '. "' BI_WRKFLW_KEY ', - 2

    'BI_RESOURCE_REF '. "" BI_RESOURCE_NM, "

    'BI_PERSONAL '. "" BI_FORMAT_NAME, "

    'BI_SO_MASTER '. "" BI_SO_FULL_NM, "

    'BI_SO_MASTER '. "" BI_OPEN_DT, "

    'BI_SO_MASTER '. "" BI_CLOSE_DT, "

    'BI_WRKFLW_TASKS '. "" BI_DURATION_DAYS, "

    "BI_WRKFLW". "" BI_EVENT_DT_TM ", -2

    'BI_SO_MASTER '. "" BI_SO_DESC, "

    'BI_TYPE_SERVICE '. "" BI_PRIM_RATE_SCHED, "

    'BI_SO_DET_VIEW_1 '. "" BI_SO_TYPE_CD, "

    'BI_SO_DET_VIEW_1 '. "" ACCT_NBR, "

    'BI_SO_DET_VIEW_1 '. "" CUST_NBR, "

    'BI_RDG '. "" BI_DMD_MULT, "

    'BI_RDG '. "" BI_MTR_MULT, "

    'BI_SO_DET_VIEW_1 '. "" BI_MAP_LOC_NBR, "

    'BI_SO_DET_VIEW_1 '. "" BI_SRV_LOC_NBR ".

    Of...

    Of all the columns in the CMD, looks like BI_SRV_LOC_NBR is used outside of CMD.  Unless you intend to miodify this query and use more outside the CMD CMD columns, you can simply delete everything except this great SELECT clause BI_SEV_LOC_NBR.

  • strange behaviuor (bug?) with view (ora-918 column ambiguously defined)

    Hello everyone,
    the following code works as expected;

    Select substr(fire_id,-4,2) ct, zone_id, (fire_id), sum (a_total) count of
    (select *)
    fire join fire_zone using (fire_id) right
    where definition_id = 1
    and checked = 1
    and substr (fire_id, 2, -4) in (21.23)
    and fire_id between 190400000000 and 200900000000)
    Group zone_id substr (fire_id, 2, -4),
    order of ct, zone_id


    but when to define a vision for the subquery:

    create or replace view tempfire as
    Select *.
    fire join fire_zone using (fire_id) right
    where definition_id = 1
    and checked = 1
    and substr (fire_id, 2, -4) in (21.23)
    and fire_id between 190400000000 and 200900000000


    then run

    Select substr(fire_id,-4,2) ct, zone_id, count of tempfire (fire_id), sum (a_total)
    Group zone_id substr (fire_id, 2, -4),
    order of ct, zone_id

    I got the error ora-00918 ambiguous column defined for zone_id.

    Is this a bug or is there a reason?

    Thank you in advance,

    See you soon,.
    Boris

    Published by: boris on November 19, 2009 06:49

    Published by: boris on November 19, 2009 06:52

    In fact, it's a bug. As a fix, the problem:

    alter session set "_column_elimination_off"=true
    /
    

    before you run the query:

    SQL> select  substr(fire_id,-4,2) as ct,zone_id,
      2          count(fire_id),sum(a_total)
      3    from  tempfire
      4    group by substr(fire_id,-4,2),
      5             zone_id
      6    order by ct,
      7             zone_id
      8  /
            count(fire_id),sum(a_total)
                               *
    ERROR at line 2:
    ORA-00918: column ambiguously defined
    
    SQL> alter session set "_column_elimination_off"=true
      2  /
    
    Session altered.
    
    SQL> select  substr(fire_id,-4,2) as ct,zone_id,
      2          count(fire_id),sum(a_total)
      3    from  tempfire
      4    group by substr(fire_id,-4,2),
      5             zone_id
      6    order by ct,
      7             zone_id
      8  /
    
    no rows selected
    
    SQL> 
    

    SY.

  • Select ambiguous column in Sub query

    I get an error "ambiguous column" when I question using a sub select. Here's my query:

    Select *.
    (select
    c.custody_id,
    c.person_id,
    n.first_name,
    n.last_name,
    z.usms_number,
    c.start_date,
    c.end_date,
    c.district_office_id,
    CBC.custody_id,
    c.update_date,
    c.update_user_id
    Guard c,.
    custody_booking_pkg_components Radio-Canada,
    z_migrate_usms_number z,
    district_office do,
    District d,
    person p,
    n name
    where
    c.person_id = p.person_id and
    z.person_id = p.person_id and
    z.Ordinal = 1 and
    c.custody_id = cbc.custody_id (+) and
    p.name_id = n.name_id and
    do.district_id = d.district_id and
    c.district_office_id = do.district_office_id and
    d.district_id = 99 by c.update_date desc order)
    where rownum < = 10;

    I understand why "ambiguous column" average error, but I don't see which column is ambiguous. I ran the select sub by itself and it works correctly, but when combined with the external selection it fails.

    Hello

    You have two columns called custody_id.
    It is normal to have names duplicated in a query, but not in a table or view (and which includes a view online, you have).

    Type a unique name for each column.

  • Change chart caption column

    Good so my problem is that I have the name of data on column B and not a. That's why I need the chart legend to be on column B has not.

    I can easily move the value of %/number through the card. But not the legend marker (?)

    Don't know what you're asking.  You try to do something like that?

    The pie chart is a graph of the category and categories must be in a column defined as column heading.

    Above, I added the B column, defined as a header row, the selected columns B and C and inserted a 2D pie chart.

    When you select columns A through C and insert a graphic you get something like this:

    SG

  • column headers dynamically change the date filter-based selection? in obiee 11g Analytics

    Hello

    I work an analytic of obiee 11g.

    I have my report coulmns five... who are the branch, district, DS, current year, the previous year.

    based on the article on the query filter, column headings change dynamically.

    column headings are current, previous year Yes r;

    current month, previous month;

    current week and the previous week.

    for example, if I select the year 2016.

    column headings are Branch, district, DS, 2016, 2015 will change dynamically in the analytical report...

    Please help me,

    I tried, but I do not have...

    Please help me,

    A.Kavya.

    I'm not really sure what you have, but assuming that you have a command prompt of dashboard with the year of the column, define a variable presentation for this column (pv_year) and then in the report, for the columns you want, set the column as header @{pv_year} and @{pv_year-1}.

    He must pick up the values from the command prompt and dynamically set in the column headers.

  • Convert a Non-virtual virtual column

    Can I convert a virtual column in a non-virtual (ordinary scalar column) or what I have to delete and recreate?

    for example, I have a virtual column defined as:

    exam_length NUMBER GENERATED ALWAYS AS ("TOTAL_SESSION_LENGTH"-NVL("TUTORIAL_LENGTH",0)-NVL("SURVEY_LENGTH",0) "")

    and I just want to:

    exam_length NUMBER (10.0)


    I tried:

    ALTER TABLE my_table () CHANGE

    EXAM_LENGTH NUMBER (10,0))

    /

    ... but that just change the data type and keeps virtual with the product still intact clause

    You would have to

    a. Add a new column (regular)

    b. copy the virtual column to the new column data

    c. drop the virtual column

    d. rename the new column

    Hemant K Chitae

  • Column Expression HTML links

    OK, so I followed some instructions that fac586 left in an answer (via link) for another question (Presentation of the State - side by side data sets), and I need help in a particular area:

    If my model 1 attribute in my custom report template looks like this...:

    < li >

    < a href = "" #DERIVED$ 01 # "title =" #ENAME #">"

    #PHOTO #.

    < span > #ENAME # </span >

    < /a >

    < /li >

    ... And my SQL query for the report looks like this:

    SELECT

    LAST_NAME,

    ' < img src = "p? n ='|| NVL(IM.ID,0) | "" height = width = 150px auto > ' IMG '.

    FROM EMPTABLE, WWV_FLOW_FILE_OBJECTS$ IM

    WHERE EMPID = SUBSTR (IM. NAME OF FILE, 1, 6)

    What is my expression of HTML to connect #ENAME # and #LAST_NAME # and #PHOTO # and #IMG # supposed to look like.  I tried the googles but in vain.

    In fact, my question is: what is the syntax for creating a derived column URL link in the attribute of expression HTML?

    AquaNX4 wrote:

    OK, so I followed some instructions that fac586 left in an answer (via link) for another question (Presentation of the State - side by side data sets), and I need help in a particular area:

    If my model 1 attribute in my custom report template looks like this...:

  • #PHOTO #.

    #ENAME #.

  • How is the derived column defined?

    ... And my SQL query for the report looks like this:

    SELECT

    LAST_NAME,

    '' IMG

    FROM EMPTABLE, WWV_FLOW_FILE_OBJECTS$ IM

    WHERE EMPID = SUBSTR (IM. NAME OF FILE, 1, 6)

    What is my expression of HTML to connect #ENAME # and #LAST_NAME # and #PHOTO # and #IMG # supposed to look like.  I tried the googles but in vain.

    In fact, my question is: what is the syntax for creating a derived column URL link in the attribute of HTML expression?

    Some things to note:

    • The main reason using custom templates, derivatives and Expressions HTML columns is to separate concerns, so that SQL and HTML are not mixed in the access layer data. Your code does not properly separate layers of access and the data structure. In the example, the element/source of the image is generated using declarative BLOB support (which is strongly recommended for all downloads of image). If it is not using this method, then put the HTML code required in the model, to recover the source of the image (and all the other required attributes) as discrete columns and reference them individually in the model using the column substitution syntax.
    • The height and width attributes are disabled, incorrectly specified using CSS syntax. The height and width HTML attributes are specified in pixels, with no units. The CSS dimensions are specified using the attribute of syle and units must be included in digital dimensions are used.
    • The alt attribute is required for the img elements.
    • Don't use undocumented objects (WWV_FLOW_FILE_OBJECTS$). A vision documented and supported (APEX_APPLICATION_FILES) is provided.
    • The source of the image that is used will not work.

    Suggest you reproduce the problem in an example on apex.oracle.com and view identification information of developer comments for the workspace.

  • Number data type used on a date column

    Hi Forum,

    I have a table with one column defined as number type.

    This column contains the date information and has an index defined on it.

    When I issue a select statement on this table based on this column for over 5 years of data, the query takes a long time.

    Select count (*) in x if date = 20070411

    The query takes a long time.

    such a situation is causing a problem when the where clause on a date, but the field filters is defined has a number type.

    All the columns in this table are defined as non-unique, but the date column seems to be more selective.

    Just curious to know if this type of data can have any impact IE do not provide the correct information to the optimizer etc.?

    Thanks for any help or advice

    Hello

    user3206995 wrote:

    Hi Forum,

    I have a table with one column defined as number type.

    This column contains the date information and has an index defined on it.

    When I issue a select statement on this table based on this column for over 5 years of data, the query takes a long time.

    Select count (*) in x if date = 20070411

    The query takes a long time.

    such a situation is causing a problem when the where clause on a date, but the field filters is defined has a number type.

    Yes; You can count on having a lot of different problems, if you are storing information on dates in NUMBER of columns.  The columns DATE to the date information.

    DATE is also a keyword from Oracle, so it's a very bad name of a column.  Use a column name as entry_date or date_column instead of just date.

    All the columns in this table are defined as non-unique, but the date column seems to be more selective.

    If

    date_column = 20070411

    is the only requirement, and it is slow, then it seems that you do not have an index on date_column, and you need to create a.

    For all performance issues, see the FAQ forum:

    Re: 3. how to improve the performance of my query? / My query is slow.

    Just curious to know if this type of data can have any impact IE do not provide the correct information to the optimizer etc.?

    It doesn't look like this problem is caused by using the wrong type of data.  Many others will, however.

  • Apex 4.2 - column HTML expression

    I have a (classical) in 4.0.2 Apex SQL statement with the next column
      decode(some_col,NULL,NULL,'class="foo"') foo
    This column does not appear in the report, but the value is used to construct the HTML Expression in another column that appears. The HTML Expression goes like this
     <img #FOO# src="/i/menu/add-small.png"/>
    It is a CSS snippet that img.foo styles as needed.

    In v4.0.2, this is made in the form
     <img class="foo" src="/i/menu/add-small.png"/>
    But in 4.2, it comes out as
     <img class=""foo"" src="/i/menu/add-small.png"/>
    Notice the doubling of the quotes. In addition to being the invalid markup, the CSS is not kick in if the element is not get made.

    Is this a bug? Either my app just against the ongoing effort to generate markup more meets standards? Is there a solution?

    Thank you

    Hi Vikas,

    can you please check what type of ' display under "your column"foo"is. Is - this "show as text (escape special characters, no State not sure)".

    For security reasons (to avoid possible XSS attacks), need to improve automatic column values avoidance, if a column is used as the value of substitution (in expressions of HTML and other places). Type "display as" the substitute column defines if the value must be escaped before replacement or if it should be used without change. So in your case if you change your column "foo" to "* Standard report column *" you should get 'foo' without the quotes escaped. To my knowledge, this security change was introduced in APEX 4.1.

    If I'm on the wrong track and it's not your symtom, can you please create a test on apex.oracle.com case.

    Concerning
    Patrick
    -----------
    My Blog: http://www.inside-oracle-apex.com
    APEX Plug-Ins: http://apex.oracle.com/plugins
    Twitter: http://www.twitter.com/patrickwolf

Maybe you are looking for