Skip to Main Content

APEX

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!

ORA-01789: query block has incorrect number of result columns

Jeffy DwitraJan 22 2016 — edited Jan 23 2016

Hi guys,

I make query like this :

select

sph.PERIODE,

spl.PERIODE_DETAIL,

SUM(case when  spl.SUB_KRITERIA = 'KEHADIRAN' then  spl.NILAI

end) AKTIFITAS_KEHADIRAN,

SUM(case when  spl.SUB_KRITERIA = 'KONSISTENSI' then  spl.NILAI

end) AKTIFITAS_KONSISTENSI,

SUM(case when  spl.SUB_KRITERIA = 'KERJASAMA' then  spl.NILAI

end) KOMUNIKASI_KERJASAMA,

SUM(case when  spl.SUB_KRITERIA = 'KOORDINASI' then  spl.NILAI

end) KOMUNIKASI_KOORDINASI,

SUM(case when  spl.SUB_KRITERIA = 'INTEGRITAS' then  spl.NILAI

end) LOYALITAS_INTEGRITAS,

SUM(case when  spl.SUB_KRITERIA = 'KEJUJURAN' then  spl.NILAI

end) LOYALITAS_KEJUJURAN,

SUM(case when  spl.SUB_KRITERIA = 'KEPATUHAN' then  spl.NILAI

end) LOYALITAS_KEPATUHAN

from sci_pk2m_line@sucodev spl, sci_pk2m_header@sucodev sph

where spl.ID_PK2M_HEADER = sph.ID_PK2M_HEADER

and sph.UNIT_KERJA = :P314_ID_UNIT_KERJA

and sph.PERIODE =   :P314_PERIODE

and sph.PERSON_ID =   :P314_NPP

group by

    sph.PERIODE,

    spl.PERIODE_DETAIL

UNION ALL

select

   no,

   KETERANGAN,

   UNIT_KERJA,

   PERIODE,

   PERSON_ID,

   AKTIFITAS_KEHADIRAN,

   AKTIFITAS_KONSISTENSI,

   KOMUNIKASI_KERJASAMA,

   KOMUNIKASI_KOORDINASI,

   LOYALITAS_INTEGRITAS,

   LOYALITAS_KEJUJURAN,

   LOYALITAS_KEPATUHAN

from

   SCI_TOTAL_PK2M_V

where PERIODE = :P314_PERIODE

and PERSON_ID = :P314_NPP;

when I compiled and run the program it's show the error like this 'ORA-01789: query block has incorrect number of result columns'

I don't know what doesnt mean,,

could you help me for my problem ?

thanks

best regards

Jeff

This post has been answered by Mahmoud_Rabie on Jan 22 2016
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 20 2016
Added on Jan 22 2016
3 comments
1,583 views