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!

How to include another data to existing pivot?

2633101Nov 21 2014 — edited Nov 21 2014

Hi, I have this query:

select *

from (

        SELECT 'RD',

               '1001142302',

               defmac.COD_MACHIN,

               machine.NUM_SERIE,

               dmag.HARDWAR_ID,

               contadores.COD_CPTE,

               contadores.VAL_CPT_OL,

               defmac.PCT_REDIST,

               case when mensajes.COD_MSG_OL = 'MDC_DISCON' then '01'

                    when mensajes.COD_MSG_OL = 'SM_DISCON' then '02'

                    when mensajes.COD_MSG_OL = 'SM_NVRAM_ERROR' then '03'

                    when mensajes.COD_MSG_OL = '1397' then '04'

                    when mensajes.COD_MSG_OL = 'EPROM_CHANGE' then '05'

                    when mensajes.COD_MSG_OL = 'SM_POWER_OFF' then '06'

                    when mensajes.COD_MSG_OL = '1402' then '07'

                    when mensajes.COD_MSG_OL = '1405' then '07'

                    when mensajes.COD_MSG_OL = '1406' then '07'

                    when mensajes.COD_MSG_OL = '1408' then '07'

                    when mensajes.COD_MSG_OL = '1412' then '07'

                    when mensajes.COD_MSG_OL = '1413' then '07'

                    when mensajes.COD_MSG_OL = '1414' then '07'

                    when mensajes.COD_MSG_OL = '1415' then '07'

                    when mensajes.COD_MSG_OL = '1419' then '07'

                    when mensajes.COD_MSG_OL = '1431' then '07'

                    when mensajes.COD_MSG_OL = '1432' then '07'

                    when mensajes.COD_MSG_OL = 'WRAP_CI' then '07'

                    when mensajes.COD_MSG_OL = 'WRAP_CO' then '07'

                    when mensajes.COD_MSG_OL = 'WRAP_CTC' then '07'

                    when mensajes.COD_MSG_OL = 'WRAP_DOPPAY' then '07'

                    when mensajes.COD_MSG_OL = 'WRAP_GM' then '07'

                    when mensajes.COD_MSG_OL = 'WRAP_TI' then '07'

                    when mensajes.COD_MSG_OL = 'WRAP_TO' then '07'

                    when mensajes.COD_MSG_OL = '1399' then '08'

                    else '00'

                    end as "CODIGO"

        FROM site.sdefmac defmac

        inner join SITE.smachin machine on defmac.COD_MACHIN = machine.COD_MACHIN

        inner join SITE.SDEFMAG dmag on defmac.COD_MACHIN = dmag.COD_MACHIN

        inner join SITE.SLCOMPT contadores on defmac.COD_MACHIN = contadores.COD_MACHIN

        inner join SITE.SHISMSG mensajes on defmac.COD_MACHIN = mensajes.COD_OBJ

        where (defmac.DAT_EDEF IS NULL or defmac.COD_MEP = 1)

        AND defmac.COD_ETATSN = '0'

        AND dmag.cod_mep = '1'

        AND (contadores.dat_ses = '2013-09-15 00:00:00'

        AND (contadores.COD_CPTE in ('TI', 'TO', 'JP', 'HP', 'BI', 'GM')))

        AND mensajes.COD_MSG_OL in ('MDC_DISCON', 'SM_DISCON', '1397', 'EPROM_CHANGE', 'SM_NVRAM_ERROR', 'SM_POWER_OFF', '1402', '1405',

        '1406', '1408', '1412', '1413', '1414', '1415', '1419', '1431', '1432', 'WRAP_CI', 'WRAP_CO', 'WRAP_CTC', 'WRAP_DOPPAY',

        'WRAP_GM', 'WRAP_TI', 'WRAP_TO', '1399')

     )

     pivot

            (

             max(VAL_CPT_OL)

             for COD_CPTE in ('TI', 'TO', 'JP', 'HP', 'BI', 'GM')

            ) order by COD_MACHIN, CODIGO;

Here is a sample of the result of this query:

RD1001142302  COD_MACHINNUM_SERIEHARDWAR_IDPCT_REDISTCODIGOTITOJPHPBIGM
RD1001142302  AT020112231010013580256274100012332187220681467192206021570157426800379082
RD1001142302AT020112231010013580256274100082332187220681467192206021570157426800379082

But, what I want to do is to put the column CODIGO in this way

RD1001142302  COD_MACHINNUM_SERIEHARDWAR_IDPCT_REDISTTITOJPHPBIGMCOD1COD2
RD1001142302  AT02011223101001358025627410023321872206814671922060215701574268003790820108

Is this possible?

Thanks.

Message was edited by: 2633101 I solved the problem, Just include my query inside another select * from ( MY QUERY) PIVOT (); Thanks.

Comments

M.bro

11g BI INSTALLATION

  To open bi installation folder (bishiphome)---> Disk 1

            Automatically open cmd prompt

  BI installation screen open click next to start the installation.

  Click the Skip software update and then click next

  select the installation type just click simple install and then click next

  After complete the prerequisite check and click next button.

  To specify installation location

  click the browse button and then create a folder to click open and then install the BI setup

  To set the Administrator details user name: Weblogic,password : oracle123, confirm password : oracle123 and then click next button.

  Just click Oracle business intelligence check box and verify all the sub menu to enable then click next button.

  To enter the Biplatform schema details and then click next button.

  To set the BIPLATFORM SCHEMA database type: oracle database, connection string: localhost:1521:orclbi(orclbi dbname),biplatform schema username : DEV_BIPLATFORM,password:oracle123 and then move next step

  uncheck the check box click next button.

  Click yes and then move to next screen

  click install start to installation progress.

  After installation progress to move next step (configuration progress)

  After complete the configuration to move the next step

  Click next after complete configuration progress (100%) then only click next button.

  Click finish button to complete the bi services

  After complete oracle business intelligence installation Go to All programs---> Oracle business intelligence -->click stop bi services --> open prompt and enter the user name : weblogic and password oracle123(enter correctly or else problem to be occurred  to services starting time)-->after enter the user name and password just enter.

After stop bi services to start the services (restart the system and then start the services)

Go to All programs---> Oracle business intelligence -->click start bi services -->loading few minutes -->after few minutes -->browser will open just wait and then refresh/reload and wait to work environment started.

sankargvs

i am not looking for generic installation steps.

My installation stuck during configuration stuck and remains there at 32%, it is not moving after that.

So its stuck. i wanted to know any specific reason why it is stuck.

That's why i have posted the installation log.

Installed JDK, then installed weblogic and ran RCU. Then did software only install and tried configuring bi_server1. Still the same problem.

M.bro

if possible take screen shot and post it and also tell installation path and setup path.

Sagar Tippe

More than 90% of the problems in OBIEE installation are just because of IP address. You can follow the steps in a link I have mentioned above.

I went through you error log, don't worry. You can rely on that link, try it. But before proceeding, make sure that you format your system to make a fresh install of OBIEE. ;-)

http://obieenow.blogspot.in/2014/01/obiee-111170-rcu-installation.html

Thanks,

Sagar Tippe

1 - 4
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Dec 19 2014
Added on Nov 21 2014
1 comment
514 views