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

Tags: Database

Similar Questions

  • 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

  • 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...

  • 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.

  • 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

  • Addition of virtual column: ORA-12899: value too large for column

    I am using Oracle 11g, OS Win7, SQL Developer

    I'm trying to add the virtual column to my test table, but get ORA-12899: value too large for column error. Here are the details.
    Can someone help me in this?
    CREATE TABLE test_reg_exp
    (col1 VARCHAR2(100));
    
    INSERT INTO test_reg_exp (col1) VALUES ('ABCD_EFGH');
    INSERT INTO test_reg_exp (col1) VALUES ('ABCDE_ABC');
    INSERT INTO test_reg_exp (col1) VALUES ('WXYZ_ABCD');
    INSERT INTO test_reg_exp (col1) VALUES ('ABCDE_PQRS');
    INSERT INTO test_reg_exp (col1) VALUES ('ABCD_WXYZ');
    ALTER TABLE test_reg_exp
    ADD (col2 VARCHAR2(100) GENERATED ALWAYS AS (REGEXP_REPLACE (col1, '^ABCD[A-Z]*_')));
    
    SQL Error: ORA-12899: value too large for column "COL2" (actual: 100, maximum: 400)
    12899. 00000 -  "value too large for column %s (actual: %s, maximum: %s)"
    *Cause:    An attempt was made to insert or update a column with a value
               which is too wide for the width of the destination column.
               The name of the column is given, along with the actual width
               of the value, and the maximum allowed width of the column.
               Note that widths are reported in characters if character length
               semantics are in effect for the column, otherwise widths are
               reported in bytes.
    *Action:   Examine the SQL statement for correctness.  Check source
               and destination column data types.
               Either make the destination column wider, or use a subset
               of the source column (i.e. use substring).
    When I try to, I get the correct results:
    SELECT col1, (REGEXP_REPLACE (col1, '^ABCD[A-Z]*_'))
    FROM test_reg_exp;
    Thank you.

    Yes, RP, it works if you give col2 size > = 400.

    @Northwest - could you please test the same w/o having a clause of regex in col2?
    I have a doubt about using a REGULAR expression in this case Dynamics col.

    Refer to this (might help) - http://www.oracle-base.com/articles/11g/virtual-columns-11gr1.php
    Below excerpt from above link... see if that helps...
    >
    Notes and restrictions on the virtual columns include:

    The indexes defined on the virtual columns are equivalent to a function-based index.
    Virtual columns can be referenced in the updates and deletions WHERE clause, but they cannot be manipulated by DML.
    The tables containing virtual columns may still be eligible for result caching.
    Functions in expressions must be deterministic when the table is created, but can then be recompiled and non-deterministic without for as much invalidate the virtual column. In such cases, the following steps must be taken after the function is recompiled:
    Constraint on the virtual column must be disabled and re-enabled.
    On the virtual column indexes must be rebuilt.
    Materialized views that access the virtual column must be fully refreshed.
    The result cache must be flushed if the virtual column acceded to the request (s).
    Statistical table must be regathered.
    The virtual columns are not supported for the organized and external object in index, cluster or temporary tables.
    The expression used in the virtual column definition has the following restrictions:
    It cannot refer to another virtual column by name.
    It can refer to the columns defined in the same table.
    If it refers to a deterministic user-defined function, it cannot be used as a partitioning key column.
    The result of the expression must be a scalar value. It cannot return that an Oracle supplied the data type, a type defined by the user, LOB or LONG RAW.
    >

    Published by: Vanessa B on October 16, 2012 23:48

    Published by: Vanessa B on October 16, 2012 23:54

  • How to use a formula in column in the main query?

    Hi all
    I tried to use a formula columns defined in a query in the State of the query like this:
    where (: cf_ex -: cf_ex2) > = 5
    but when I run the report returned data! Why? and how to use the status of the query?

    Note: I'm using Forms 6i

    I gave you the reason:

    Formula columns are not part of the select statement (which runs in the database), but are dealt with in the report.
    So you actually reference the user settings in the query, not formulas columns.

    (Well, I should have said "you are referencing empty connection parameters", but with your experience you could have understood that)
    and the solution:

    Create database for cf_ex and cf_ex2 functions and use them in your application.

  • String truncation warning Possible - 1241024 - in the column #.

    I am running the following command in a simple MaxL script, whose output is sent to a text file:

    display variable App.DB.SubVar;

    The text file seems to have raised very well, with the value of substitution displayed variable. However, the following warnings appear each time that the stderr output. Should I be worried? Is it possible to fix this?

    WARNING - 1241024 - Possible string truncation in column 3.
    WARNING - 1241028 - output column defined with warnings.
    WARNING - 1241024 - Possible string truncation in column 4.
    WARNING - 1241028 - output column defined with warnings.

    This is only a warning saying that it is possible that it may be truncated, I don't think it is to check to see the full size

    If you set it to something like
    Set column_width 1028;

    and start the variable display again and will probably not all of the warnings.

    See you soon

    John
    http://John-Goodwin.blogspot.com/

Maybe you are looking for

  • HP Pavilion 17-e171ed: Bluetooth network card does not

    I have never changed the network card by default since I bought the pc and I have always used a Bluetooth dongle, but now I have recently discovered that my card also has bluetooth. So, to my knowledge, I wouldn't need the dongle at all. But here's t

  • Outline of the block diagram flashing red

    Hello. I don't have access to the Vi in question at the moment so I'll make it as General as possible. My Vi worked properly for a week or two, but today it started to flash red around the edge of the block diagram. Once the Vi makes the block diagra

  • Cannot install windows update, error: 80070426.

    Original title: My Vista can not search for new updates My Vista (Version 6.0, build 6002:sercice pack2), can not search for new updates. I get error code 80070426 "Windows could not search for new updates". I tried troubleshooting Microsoft online,

  • What should I do if he ceased to dell support center back work?

    Im trying to install windows updates on my computer but I get an error message that says that windows has encountered an unknown error... I get a message saying that dell support center has stopped working. A problem caused the blocking of the progra

  • No sound on DC7700p suite pitfalls of XP on reformatted hard drive

    I have mistakenly reformatted my hard drive after several error messages probably caused by too many software conflicts after years download various programs, deleting etc. My DC7700p is up and running fine, faster that previously, however I have no