Extract data using SQL Expression

Hello, I created an intermediate table and just realized that I need some new additional fields.
Should I create them in the scene or in the target table?

I want to use the SQL COUNT expression to fill these new data sources published, fields
but do not know exactly how do. I'm a little amateur.

Thank you.

You should check the analytical functions:

http://www.orafaq.com/node/55

Tags: Business Intelligence

Similar Questions

  • How to view clob data using sql

    Hello

    In our database we have a table that is to have a column of type CLOB but now I want to display the data using sql select query but it throws error: "unsupported data Type.

    Could someone let me know how to view the clob data using the select query.

    Oracle DB version: 10.2.0.3

    Thank you

    user562223 wrote:
    Hello

    In our database we have a table that is to have a column of type CLOB but now I want to display the data using sql select query but it throws error: "unsupported data Type.

    Could someone let me know how to view the clob data using the select query.

    Oracle DB version: 10.2.0.3

    Thank you

    Usually a to_char (CLOBDFIELD) circled

    HTH,

    FJFranken

  • Error when you try to use SQL Express 2012 import/export wizard

    When you try to use 'Import and data export' Wizard SQL Server 2012 Express with Advanced Services, I get the following error message:

    I tried everything I can think of. I tried to copy this .dll on various windows system files, by registering the .dll file, even tried to not downgrading from SQL Express 2016 until 2012... no luck, still the same problem. I tried everything on at least the first five pages of a Google search. I am running it in a box of Windows 7 Pro 32-bit. I used the x 86 version of SQL Express 2012 with Advanced Services and all the features were installed during the installation.

    Any help would be greatly appreciated.

    This issue is beyond the scope of this site (for consumers) and to be sure, you get the best (and fastest) reply, we have to ask either on Technet (for IT Pro) or MSDN (for developers)
    *
  • How to extract data from SQL server in the FDM

    Hi Experts

    How to extract data from a SQL server HFM to another SQL Server using scripts for integration in FDQM?

    concerning

    Dev

    Could you clarify why you want to do this?

    If you try to synchronize two databases (apps) to have a backup or something running in a development environment, I suggest configuring replication between two databases. It would be much more effective to do it at the SQL Server level through the application of FDM, IMHO.

    Charles

  • How to skip the installation of SQL Express 2005 and using SQL Express 2008 instead?

    I have SQL Express 2008 is installed and you want to use instead of SQL Express 2005.

    How to configure the installation of Lookout as he ignores the installation of SQL Express 2005?

    Are there other measures that must be taken so that Lookout can work properly with SQL Express 2008?

    Thank you.

    OK - it worked.

    However, for 64-bit installations, I had to use the WOW of SQL Express 2008 versions, because, the Citadel is a 32-bit database and installation of 64-bit native versions would not allow an upgrade of the Citadel of Instance.

    Thank you.

  • How to extract data using bluetooth other device...

    Hi all

    First, I describe my problem:

    I want an application that extract the xml data in ECG device using bluetooth after accessing this data make some calculation and send it to the server... I am able to serach all the device compatible bluetooth after that, I am also able to connect from the particular device... (Now I use bluetooth Simple device as phone, pc or anything which is Bluetooth)

    Now the problem is... After connection of the device, I want to go get a (for example an image or text document.) file of the device connected using my camera...

    can anyone know how to extract data or file to another device that is currently associated with my camera... using BlackBerry device...

    Please help me to overcome this problem...

    Currently, I am working with Blackberry.6

    As suggested, I would recommend you try the samples provided.

  • Question to load data using sql loader in staging table, and then in the main tables!

    Hello

    I'm trying to load data into our main database table using SQL LOADER. data will be provided in separate pipes csv files.

    I have develop a shell script to load the data and it works fine except one thing.

    Here are the details of a data to re-create the problem.

    Staging of the structure of the table in which data will be filled using sql loader

    create table stg_cmts_data (cmts_token varchar2 (30), CMTS_IP varchar2 (20));

    create table stg_link_data (dhcp_token varchar2 (30), cmts_to_add varchar2 (200));

    create table stg_dhcp_data (dhcp_token varchar2 (30), DHCP_IP varchar2 (20));

    DATA in the csv file-

    for stg_cmts_data-

    cmts_map_03092015_1.csv

    WNLB-CMTS-01-1. 10.15.0.1

    WNLB-CMTS-02-2 | 10.15.16.1

    WNLB-CMTS-03-3. 10.15.48.1

    WNLB-CMTS-04-4. 10.15.80.1

    WNLB-CMTS-05-5. 10.15.96.1

    for stg_dhcp_data-

    dhcp_map_03092015_1.csv

    DHCP-1-1-1. 10.25.23.10, 25.26.14.01

    DHCP-1-1-2. 56.25.111.25, 100.25.2.01

    DHCP-1-1-3. 25.255.3.01, 89.20.147.258

    DHCP-1-1-4. 10.25.26.36, 200.32.58.69

    DHCP-1-1-5 | 80.25.47.369, 60.258.14.10

    for stg_link_data

    cmts_dhcp_link_map_0309151623_1.csv

    DHCP-1-1-1. WNLB-CMTS-01-1,WNLB-CMTS-02-2

    DHCP-1-1-2. WNLB-CMTS-03-3,WNLB-CMTS-04-4,WNLB-CMTS-05-5

    DHCP-1-1-3. WNLB-CMTS-01-1

    DHCP-1-1-4. WNLB-CMTS-05-8,WNLB-CMTS-05-6,WNLB-CMTS-05-0,WNLB-CMTS-03-3

    DHCP-1-1-5 | WNLB-CMTS-02-2,WNLB-CMTS-04-4,WNLB-CMTS-05-7

    WNLB-DHCP-1-13 | WNLB-CMTS-02-2

    Now, after loading these data in the staging of table I have to fill the main database table

    create table subntwk (subntwk_nm varchar2 (20), subntwk_ip varchar2 (30));

    create table link (link_nm varchar2 (50));

    SQL scripts that I created to load data is like.

    coil load_cmts.log

    Set serveroutput on

    DECLARE

    CURSOR c_stg_cmts IS SELECT *.

    OF stg_cmts_data;

    TYPE t_stg_cmts IS TABLE OF stg_cmts_data % ROWTYPE INDEX BY pls_integer;

    l_stg_cmts t_stg_cmts;

    l_cmts_cnt NUMBER;

    l_cnt NUMBER;

    NUMBER of l_cnt_1;

    BEGIN

    OPEN c_stg_cmts.

    Get the c_stg_cmts COLLECT in BULK IN l_stg_cmts;

    BECAUSE me IN l_stg_cmts. FIRST... l_stg_cmts. LAST

    LOOP

    SELECT COUNT (1)

    IN l_cmts_cnt

    OF subntwk

    WHERE subntwk_nm = l_stg_cmts (i) .cmts_token;

    IF l_cmts_cnt < 1 THEN

    INSERT

    IN SUBNTWK

    (

    subntwk_nm

    )

    VALUES

    (

    l_stg_cmts (i) .cmts_token

    );

    DBMS_OUTPUT. Put_line ("token has been added: ' |") l_stg_cmts (i) .cmts_token);

    ON THE OTHER

    DBMS_OUTPUT. Put_line ("token is already present'");

    END IF;

    WHEN l_stg_cmts EXIT. COUNT = 0;

    END LOOP;

    commit;

    EXCEPTION

    WHILE OTHERS THEN

    Dbms_output.put_line ('ERROR' |) SQLERRM);

    END;

    /

    output

    for dhcp


    coil load_dhcp.log

    Set serveroutput on

    DECLARE

    CURSOR c_stg_dhcp IS SELECT *.

    OF stg_dhcp_data;

    TYPE t_stg_dhcp IS TABLE OF stg_dhcp_data % ROWTYPE INDEX BY pls_integer;

    l_stg_dhcp t_stg_dhcp;

    l_dhcp_cnt NUMBER;

    l_cnt NUMBER;

    NUMBER of l_cnt_1;

    BEGIN

    OPEN c_stg_dhcp.

    Get the c_stg_dhcp COLLECT in BULK IN l_stg_dhcp;

    BECAUSE me IN l_stg_dhcp. FIRST... l_stg_dhcp. LAST

    LOOP

    SELECT COUNT (1)

    IN l_dhcp_cnt

    OF subntwk

    WHERE subntwk_nm = l_stg_dhcp (i) .dhcp_token;

    IF l_dhcp_cnt < 1 THEN

    INSERT

    IN SUBNTWK

    (

    subntwk_nm

    )

    VALUES

    (

    l_stg_dhcp (i) .dhcp_token

    );

    DBMS_OUTPUT. Put_line ("token has been added: ' |") l_stg_dhcp (i) .dhcp_token);

    ON THE OTHER

    DBMS_OUTPUT. Put_line ("token is already present'");

    END IF;

    WHEN l_stg_dhcp EXIT. COUNT = 0;

    END LOOP;

    commit;

    EXCEPTION

    WHILE OTHERS THEN

    Dbms_output.put_line ('ERROR' |) SQLERRM);

    END;

    /

    output

    for link -.

    coil load_link.log

    Set serveroutput on

    DECLARE

    l_cmts_1 VARCHAR2 (4000 CHAR);

    l_cmts_add VARCHAR2 (200 CHAR);

    l_dhcp_cnt NUMBER;

    l_cmts_cnt NUMBER;

    l_link_cnt NUMBER;

    l_add_link_nm VARCHAR2 (200 CHAR);

    BEGIN

    FOR (IN) r

    SELECT dhcp_token, cmts_to_add | ',' cmts_add

    OF stg_link_data

    )

    LOOP

    l_cmts_1: = r.cmts_add;

    l_cmts_add: = TRIM (SUBSTR (l_cmts_1, 1, INSTR (l_cmts_1, ',') - 1));

    SELECT COUNT (1)

    IN l_dhcp_cnt

    OF subntwk

    WHERE subntwk_nm = r.dhcp_token;

    IF l_dhcp_cnt = 0 THEN

    DBMS_OUTPUT. Put_line ("device not found: ' |") r.dhcp_token);

    ON THE OTHER

    While l_cmts_add IS NOT NULL

    LOOP

    l_add_link_nm: = r.dhcp_token |' _TO_' | l_cmts_add;

    SELECT COUNT (1)

    IN l_cmts_cnt

    OF subntwk

    WHERE subntwk_nm = TRIM (l_cmts_add);

    SELECT COUNT (1)

    IN l_link_cnt

    LINK

    WHERE link_nm = l_add_link_nm;

    IF l_cmts_cnt > 0 AND l_link_cnt = 0 THEN

    INSERT INTO link (link_nm)

    VALUES (l_add_link_nm);

    DBMS_OUTPUT. Put_line (l_add_link_nm |) » '||' Has been added. ") ;

    ELSIF l_link_cnt > 0 THEN

    DBMS_OUTPUT. Put_line (' link is already present: ' | l_add_link_nm);

    ELSIF l_cmts_cnt = 0 then

    DBMS_OUTPUT. Put_line (' no. CMTS FOUND for device to create the link: ' | l_cmts_add);

    END IF;

    l_cmts_1: = TRIM (SUBSTR (l_cmts_1, INSTR (l_cmts_1, ',') + 1));

    l_cmts_add: = TRIM (SUBSTR (l_cmts_1, 1, INSTR (l_cmts_1, ',') - 1));

    END LOOP;

    END IF;

    END LOOP;

    COMMIT;

    EXCEPTION

    WHILE OTHERS THEN

    Dbms_output.put_line ('ERROR' |) SQLERRM);

    END;

    /

    output

    control files -

    DOWNLOAD THE DATA

    INFILE 'cmts_data.csv '.

    ADD

    IN THE STG_CMTS_DATA TABLE

    When (cmts_token! = ") AND (cmts_token! = 'NULL') AND (cmts_token! = 'null')

    and (cmts_ip! = ") AND (cmts_ip! = 'NULL') AND (cmts_ip! = 'null')

    FIELDS TERMINATED BY ' |' SURROUNDED OF POSSIBLY "" "

    TRAILING NULLCOLS

    ('RTRIM (LTRIM (:cmts_token))' cmts_token,

    cmts_ip ' RTRIM (LTRIM(:cmts_ip)) ")". "

    for dhcp.


    DOWNLOAD THE DATA

    INFILE 'dhcp_data.csv '.

    ADD

    IN THE STG_DHCP_DATA TABLE

    When (dhcp_token! = ") AND (dhcp_token! = 'NULL') AND (dhcp_token! = 'null')

    and (dhcp_ip! = ") AND (dhcp_ip! = 'NULL') AND (dhcp_ip! = 'null')

    FIELDS TERMINATED BY ' |' SURROUNDED OF POSSIBLY "" "

    TRAILING NULLCOLS

    ('RTRIM (LTRIM (:dhcp_token))' dhcp_token,

    dhcp_ip ' RTRIM (LTRIM(:dhcp_ip)) ")". "

    for link -.

    DOWNLOAD THE DATA

    INFILE 'link_data.csv '.

    ADD

    IN THE STG_LINK_DATA TABLE

    When (dhcp_token! = ") AND (dhcp_token! = 'NULL') AND (dhcp_token! = 'null')

    and (cmts_to_add! = ") AND (cmts_to_add! = 'NULL') AND (cmts_to_add! = 'null')

    FIELDS TERMINATED BY ' |' SURROUNDED OF POSSIBLY "" "

    TRAILING NULLCOLS

    ('RTRIM (LTRIM (:dhcp_token))' dhcp_token,

    cmts_to_add TANK (4000) RTRIM (LTRIM(:cmts_to_add)) ")" ""

    SHELL SCRIPT-

    If [!-d / log]

    then

    Mkdir log

    FI

    If [!-d / finished]

    then

    mkdir makes

    FI

    If [!-d / bad]

    then

    bad mkdir

    FI

    nohup time sqlldr username/password@SID CONTROL = load_cmts_data.ctl LOG = log/ldr_cmts_data.log = log/ldr_cmts_data.bad DISCARD log/ldr_cmts_data.reject ERRORS = BAD = 100000 LIVE = TRUE PARALLEL = TRUE &

    nohup time username/password@SID @load_cmts.sql

    nohup time sqlldr username/password@SID CONTROL = load_dhcp_data.ctl LOG = log/ldr_dhcp_data.log = log/ldr_dhcp_data.bad DISCARD log/ldr_dhcp_data.reject ERRORS = BAD = 100000 LIVE = TRUE PARALLEL = TRUE &

    time nohup sqlplus username/password@SID @load_dhcp.sql

    nohup time sqlldr username/password@SID CONTROL = load_link_data.ctl LOG = log/ldr_link_data.log = log/ldr_link_data.bad DISCARD log/ldr_link_data.reject ERRORS = BAD = 100000 LIVE = TRUE PARALLEL = TRUE &

    time nohup sqlplus username/password@SID @load_link.sql

    MV *.log. / log

    If the problem I encounter is here for loading data in the link table that I check if DHCP is present in the subntwk table, then continue to another mistake of the newspaper. If CMTS then left create link to another error in the newspaper.

    Now that we can here multiple CMTS are associated with unique DHCP.

    So here in the table links to create the link, but for the last iteration of the loop, where I get separated by commas separate CMTS table stg_link_data it gives me log as not found CMTS.

    for example

    DHCP-1-1-1. WNLB-CMTS-01-1,WNLB-CMTS-02-2

    Here, I guess to link the dhcp-1-1-1 with balancing-CMTS-01-1 and wnlb-CMTS-02-2

    Theses all the data present in the subntwk table, but still it gives me journal wnlb-CMTS-02-2 could not be FOUND, but we have already loaded into the subntwk table.

    same thing is happening with all the CMTS table stg_link_data who are in the last (I think here you got what I'm trying to explain).

    But when I run the SQL scripts in the SQL Developer separately then it inserts all valid links in the table of links.

    Here, she should create 9 lines in the table of links, whereas now he creates only 5 rows.

    I use COMMIT in my script also but it only does not help me.

    Run these scripts in your machine let me know if you also get the same behavior I get.

    and please give me a solution I tried many thing from yesterday, but it's always the same.

    It is the table of link log

    link is already present: dhcp-1-1-1_TO_wnlb-cmts-01-1

    NOT FOUND CMTS for device to create the link: wnlb-CMTS-02-2

    link is already present: dhcp-1-1-2_TO_wnlb-cmts-03-3
    link is already present: dhcp-1-1-2_TO_wnlb-cmts-04-4

    NOT FOUND CMTS for device to create the link: wnlb-CMTS-05-5

    NOT FOUND CMTS for device to create the link: wnlb-CMTS-01-1

    NOT FOUND CMTS for device to create the link: wnlb-CMTS-05-8
    NOT FOUND CMTS for device to create the link: wnlb-CMTS-05-6
    NOT FOUND CMTS for device to create the link: wnlb-CMTS-05-0

    NOT FOUND CMTS for device to create the link: wnlb-CMTS-03-3

    link is already present: dhcp-1-1-5_TO_wnlb-cmts-02-2
    link is already present: dhcp-1-1-5_TO_wnlb-cmts-04-4

    NOT FOUND CMTS for device to create the link: wnlb-CMTS-05-7

    Device not found: wnlb-dhcp-1-13

    IF NEED MORE INFORMATION PLEASE LET ME KNOW

    Thank you

    I felt later in the night that during the loading in the staging table using UNIX machine he created the new line for each line. That is why the last CMTS is not found, for this I use the UNIX 2 BACK conversion and it starts to work perfectly.

    It was the dos2unix error!

    Thank you all for your interest and I may learn new things, as I have almost 10 months of experience in (PLSQL, SQL)

  • Error loading data using SQL loader

    I get an error message like "SQL * Loader - 350 combination illegal syntax of non-alphanumeriques characters error during loading of a file using SQL loader in RHEL." The command used to run SQL * Loader is:

    Sqlldr userid = < user name > / < password > control = data.ctl

    The control file is data.ctl:

    DOWNLOAD the data

    INFILE ' / home/oraprod/data.txt'

    Add in the table test

    {

    EmpID completed by «,»,

    fname completed by «,»,

    lname completed by «,»,

    treatment is completed with a white space

    }

    The data.txt file is:

    1, Kaushal, Hamad, 5000

    2, Chetan, Hamad, 1000

    Hopefully, my question is clear.

    Please get back with the answer to my query.

    Concerning

    Replace "{" by "("dans votre fichier de contrôle) "

    DOWNLOAD the data

    INFILE 'c:\data.txt.

    Add the emp_t table

    (

    EmpID completed by «,»,

    fname completed by «,»,

    lname completed by «,»,

    treatment is completed with a white space

    )

    C:\>sqlldr user/pwd@database control = c.ctl

    SQL * Loader: release 10.2.0.3.0 - Production on Wed Nov 13 10:10:24 2013

    Copyright (c) 1982, 2005, Oracle.  All rights reserved.

    Commit the point reached - the number of logical records 1

    Commit the point reached - the number of logical records 2

    SQL > select * from emp_t;

    EMPID, FNAME LNAME SALARY

    ---------- -------------------- -------------------- ----------

    1 kone hamadi 5000

    2 Chetan Hamad 1000

    Best regards

    Mohamed Houri

  • vCenter database using SQL Express Edition

    VMware dear Experts,

    If I use the following sql express edition for vCenter database, so I would like to know what will be the maximum size of vCenter database and host how much we can add in vCenter server.

    SQL express edition 2000 32/64 bit

    SQL express edition 2005 32/64 bit

    SQL express edition 2008 32/64 bit

    SQL express edition 2012 32/64 bit

    Concerning

    Mr. VMware

    The limitation is NOT on the number of hosts or VMs. SQL limitation only based on size.

    SQL Express 2005/2008 - 4 GB

    SQL Express 2008 R2 to 10 GB

    SQL Express 2012 to 10 GB

  • Logic to find particular weekdays after a given date, using SQL

    Hello Experts,

    Version: Oracle 11G

    Could you please help me with logic to find a day of special week after a date in SQL
    For example, I need to know the first Friday after today's date.

    Thank you for your help.

    I hope that under query will be useful for you.

    SELECT NEXT_DAY(SYSDATE,'FRIDAY') "NEXT DAY"
    FROM DUAL
    
    Output:
    
            NEXT DAY
         2/24/2012 12:06:48 PM
    
  • To change the way of afficherdans the data using SQL

    I have data as follows:

    Name age
    Tom 24
    Harry 45
    Mona 30


    I want to convert these data in the way below

    Name1, name2 Age1 Age2 Name3 3
    24 45 30 Mona Harry Tom



    How can I do the same thing using SQL?

    Why not try to search this forum of 'PIVOT' to make this small change yourself?

    SQL> set line 1000
    SQL> WITH t AS (SELECT 101 empid,45 marks,8 rank FROM dual UNION ALL
      2             SELECT 101 empid,62 marks,7 FROM dual UNION ALL
      3             SELECT 101 empid,80 marks,2 FROM dual UNION ALL
      4             SELECT 102 empid,67 marks,5 FROM dual UNION ALL
      5             SELECT 102 empid,56 marks,6 FROM dual UNION ALL
      6             SELECT 103 empid,87 marks,7 FROM dual UNION ALL
      7             SELECT 103 empid,55 marks,9 FROM dual UNION ALL
      8             SELECT 103 empid,60 marks,6 FROM dual UNION ALL
      9             SELECT 103 empid,70 marks,3 FROM dual
     10             )
     11  ---End of Sample Data
     12  ---Now the original query.
     13  SELECT empid, MAX(DECODE(rn1,1,marks)) Marks1,MAX(DECODE(rn1,1,rank)) Rank1
     14              , MAX(DECODE(rn1,2,marks)) Marks2,MAX(DECODE(rn1,2,rank)) Rank2
     15              , MAX(DECODE(rn1,3,marks)) Marks3,MAX(DECODE(rn1,3,rank)) Rank3
     16              , MAX(DECODE(rn1,4,marks)) Marks4,MAX(DECODE(rn1,4,rank)) Rank4
     17  FROM
     18     (SELECT empid,marks,rank,
     19      ROW_NUMBER() OVER(PARTITION BY empid ORDER BY marks) rn1
     20      FROM t)
     21  GROUP BY empid;
    
         EMPID     MARKS1      RANK1     MARKS2      RANK2     MARKS3      RANK3     MARKS4      RANK4
    ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------
           101         45          8         62          7         80          2
           102         56          6         67          5
           103         55          9         60          6         70          3         87          7
    
    SQL> 
    
  • How to extract data using substring &amp; Instring

    Hello

    I have data like

    a_76488b_2780c

    a_76488b_2780c_

    a_76488b_c2780

    a_76488b_c2780

    a_31487b_5542

    a_76488b_2780

    I want to extract data such as the last 4 digits digital only

    2780

    2780

    2780

    2780

    5542

    2780

    Without regexp? It depends on your comments... If you know a definitive character set you want to replace, and then you can go for:

    (strictly dependent on your entry in the question)

    SELECT TRANSLATE)

    SUBSTR (RTRIM (str, '_'), INSTR (RTRIM (str, '_'), '_',-1) + 1);

    '~c_',' ')

    Str

    T;

    See you soon,.

    Manik.

  • How to extract data using PL/SQL

    Hello
    I'm new to XMl, I just need to extract the id, type, the number from below because of the xml data. Any help will be much appreciated.

    < SOAP - ENV:Envelope xmlns:SOAP - ENV = "http://schemas.xmlsoap.org/soap/envelope/" xmlns:i24n = "http://www.w3.org/2005/09/ws-i24n" xmlns:typ = "http://oracle.com/determinations/server/10.3/rulebase/assess/types" >
    < SOAP - ENV:Envelope >
    < SOAP - ENV:Header >
    < i24n:international >
    en_US < i24n: local > < / i24n: local >
    < i24n:tz > GMT-0700 < / i24n:tz >
    < / i24n:international >
    < / SOAP - ENV:Header >
    < SOAP - ENV:Body >
    < type: assessment / response >
    < type: global instance >
    < typ:attribute id = "myfee" type = "currency" >
    < typ:number - 6.0 > out < / typ:number - out >
    < / typ:attribute >
    < typ:entity id = "entity_fee" >
    < typ:instance id = "8899776" >
    < typ:attribute id = "mycost" type = "currency" deducted = "true" >
    < typ:number - 108.0 > out < / typ:number - out >
    < / typ:attribute >
    < typ:attribute id = "myplace" type = "text" >
    < typ:text - out > K < / typ:text - out >
    < / typ:attribute >
    < typ:attribute id = "myroll" type = "text" >
    < typ:text - out > NNA < / typ:text - out >
    < / typ:attribute >
    < / typ:instance >
    < / typ:entity >
    < / typ: global instance >
    < / typ: assess / answer >
    < / SOAP - ENV:Body >
    < / SOAP - ENV:Envelope >

    Thank you

    Mhand

    Works for me.

    If you want to retrieve the attributes at different levels, use a descendant axis:

    SQL> with t as(
      2  select xmltype(
      3  '
      6  
      7  
      8  en_US
      9  GMT-0700
     10  
     11  
     12  
     13  
     14  
     15  
     16  100.0
     17  
     18  
     19  
     20  
     21  16.0
     22  
     23  
     24  D
     25  
     26  
     27  
     28  
     29  
     30  
     31  ') col
     32  from dual)
     33  select x.*
     34  from t,
     35       xmltable(XMLNamespaces('http://schemas.xmlsoap.org/soap/envelope/' AS "SOAP-ENV",
     36                                'http://oracle.com/determinations/server/10.3/rulebase/assess/types' AS "typ")
     37       , 'SOAP-ENV:Envelope/SOAP-ENV:Body/typ:assess-response/typ:global-instance/descendant::typ:attribute'
     38         passing t.col
     39         columns
     40           id_1 varchar2(100) path '@id',
     41           type_1 varchar2(100) path '@type',
     42           val varchar2(100) path 'typ:number-val'
     43       ) x
     44  ;
    
    ID_1                     TYPE_1        VAL
    ------------------------ ------------- ----------
    Currency_type            dollar        100.0
    currency_fee             dollar        16.0
    currency_v_type          USD
     
    
  • Extract data from SQL to Pivot Table/CUBE database vFoglight?

    Our CIO request hourly data so he can create a history of our virtual environment using the data collected from vFoglight the BODs to attend so that they can see ho are we utulizing the new environment, they allowed us to buy. I've created a report for him but he won't have to copy and paste data in an excel file, every hour, it's short.

    It looks like this:

    dnsName Name Use (%)
    ESXi Server 1 Memory 42
    ESXi Server 2 Memory 37

    So is there a way to allow Excel to connect to SQL Server and extract this data so that it can organize itself? Or can we write a report that displays data on time as follows?

    I.E.

    01:00 - 42%

    02:00 - 39%

    03:00 - 41%

    Hi Morgan,.

    There are a few examples of the extraction of metrics data formatted in Foglight using command-line scripts in the blog article Foglight Reporting using queries metric or Groovy to http://en.community.dell.com/techcenter/performance-monitoring/foglight-administrators/w/admins-wiki/5654.foglight-reporting-using-metric-queries-or-groovy

    I hope this will give you some ideas.

    Kind regards

    Brian Wheeldon

  • Select quarterly data using SQL

    All-

    The database version that I use is 10.2.0.4.0

    This is probably simple, but for the life of me, I can't understand it. I have a table of approximately 200 Codes and a table that contains millions of records that are obliterated (data are from 1995 to sysdate). I need a query for a view to be used in a report that will show you the different codes used by the employee for specific areas based on a date parameter. If they have no data for this quarter I want to still show the quarter show 0 for the number.

    I created this simple example. If I see someone how I can integrate this logic in what I do.

    SQL for the test data:
    create the table bunch_of_codes
    (id_code number (12) primary key,)
    Description varchar2 (10));

    insert into bunch_of_codes
    values (1, 'APPLE');

    insert into bunch_of_codes
    values (2, 'ORANGE');

    insert into bunch_of_codes
    values (3, 'GRAPE');

    create the table bunch_of_data
    (id_code, number (12),)
    date of activity_date,
    CONSTRAINT data_id_code
    FOREIGN KEY (id_code) REFERENCES bunch_of_codes (id_code));

    INSERT INTO bunch_of_data
    VALUES (1, to_date('4/12/2011','MM/DD/YYYY'));

    INSERT INTO bunch_of_data
    VALUES (1, to_date('6/1/2011','MM/DD/YYYY'));

    INSERT INTO bunch_of_data
    VALUES (3, to_date('1/15/2011','MM/DD/YYYY'));

    INSERT INTO bunch_of_data
    VALUES (3, to_date('4/17/2011','MM/DD/YYYY'));

    INSERT INTO bunch_of_data
    VALUES (3, to_date('11/11/2011','MM/DD/YYYY'));

    COMMIT;

    What I see when I run the SQL statement is:
    DESCRIPTION QUARTER COUNTY
    ----------- ------- -----
    APPLE 1 0
    2 2 APPLE
    APPLE 3 0
    APPLE 4 0
    1 1 GRAPE
    1 2 GRAPES
    GRAPES 3 0
    4 1 GRAPE
    ORANGE 1 0
    ORANGE 2-0
    ORANGE 3 0
    ORANGE 4 0

    I need each printed code without worrying if it was not used. If it has not been used, I want to still see each quarter but show 0 for count.

    For this example, I can run this SQL to join the data:
    Select c.description,
    to_char(d.activity_date,'Q') quarter,
    Count County (d.id_code)
    of bunch_of_codes c,.
    bunch_of_data d
    where c.id_code = d.id_code
    C.description group, to_char(d.activity_date,'Q')
    order of description, quarter

    But if it is not no matter how much detail for the quarter then I don't get a row of data. I tried all sorts of things, but nothing seems to work.

    Please help if you have any ideas.

    Hi MLBrown,

    Here's a query that gives what you asked.
    Note: My table bunch_of_data has three lines that you have published, more a fourth line (the activity_date of this row is April 12, 2010, in the format DD-MON-YYYY).
    To account for the response you gave to the question of Etbin, a column Y (for data year) is included in the output. In this output, there is for the year, Q for the quarter and the total for the count.

    SQL> select * from bunch_of_codes;
    
       ID_CODE DESCRIPTION
    ---------- -----------
             1 APPLE
             2 ORANGE
             3 GRAPE
    
    SQL> select * from bunch_of_data;
    
       ID_CODE ACTIVITY_DATE
    ---------- ---------------
             1 12-APR-2010
             1 12-APR-2011
             1 01-JUN-2011
             3 15-JAN-2011
             3 17-APR-2011
             3 11-NOV-2011
    
    6 rows selected.
    
    SQL> with a as(select mi + level - 1 as y
      2            from (select min(extract(year from activity_date)) mi,
      3                         max(extract(year from activity_date)) ma
      4                         from bunch_of_data
      5                 )
      6           connect by level <= ma - mi + 1
      7            ),
      8       qt as(select '1' q from   dual
      9            union all
     10            select '2' from dual
     11            union all
     12            select '3' from dual
     13            union all
     14            select '4' from dual),
     15       allt as(select b.id_code,b.description,a.y, qt.q  as q
     16              from   bunch_of_codes b,a,qt
     17              ),
     18       temp as(select id_code,y,q,count(1) co
     19      from (select bd.id_code,extract(year from bd.activity_date) y,
     20                   to_char(bd.activity_date,'Q') q
     21      from   bunch_of_data bd)
     22      group by id_code, y,q)
     23      select allt.id_code,allt.description,allt.y,allt.q,nvl(co,0) total
     24      from allt,temp
     25      where allt.id_code =temp.id_code(+)
     26            and  allt.y=temp.y(+)
     27            and allt.q=temp.q(+)
     28      order by allt.id_code, allt.y, allt.q;
    
       ID_CODE DESCRIPTION          Y Q      TOTAL
    ---------- ----------- ---------- - ----------
             1 APPLE             2010 1          0
             1 APPLE             2010 2          1
             1 APPLE             2010 3          0
             1 APPLE             2010 4          0
             1 APPLE             2011 1          0
             1 APPLE             2011 2          2
             1 APPLE             2011 3          0
             1 APPLE             2011 4          0
             2 ORANGE            2010 1          0
             2 ORANGE            2010 2          0
             2 ORANGE            2010 3          0
    
       ID_CODE DESCRIPTION          Y Q      TOTAL
    ---------- ----------- ---------- - ----------
             2 ORANGE            2010 4          0
             2 ORANGE            2011 1          0
             2 ORANGE            2011 2          0
             2 ORANGE            2011 3          0
             2 ORANGE            2011 4          0
             3 GRAPE             2010 1          0
             3 GRAPE             2010 2          0
             3 GRAPE             2010 3          0
             3 GRAPE             2010 4          0
             3 GRAPE             2011 1          1
             3 GRAPE             2011 2          1
    
       ID_CODE DESCRIPTION          Y Q      TOTAL
    ---------- ----------- ---------- - ----------
             3 GRAPE             2011 3          0
             3 GRAPE             2011 4          1
    
    24 rows selected.
    
    SQL>
    

    Edited by: Manguilibe Jan 28 KAO. 2012 01:06

Maybe you are looking for

  • How to access the function of magnification?

    How to access the magnifcation function?

  • HP elitebook 8530p: bios password hp elitebook 8530p rest

    Hi my names brandon I work for a computer shop and has recently had a computer come with a bios password to this topic, I was not able to find a rider all were on the mobo and have not yet find a way to clear the bios password, it's a hp elitebook 85

  • Index of the current visible item ListView

    Hello Maby someone here knows how to do this I have a ListView that shows only 1 point in time (scroll in a horizontal direction) What signal to use or how to get the index of the currently selected item This is necessary because of this example: |--

  • Windows Media player or Windows Media Center can be used as a upnp client?

    Windows Media Player / Center to Winbdows 7 as a UPNP client? I'd really like to have this question answered for once and all. Can the Player Windows Media center to Win 7 be used as a upnp client? I want to use it to play movies on a HD support conn

  • Spam and Virus Blocker application upgrade

    Hello I just upgrade the AsyncOS on one of our trainers - there has never been an OS upgrade since it is installed. It seems to be stuck on 15% Application Installer (has been for the last hour). Is this normal, or is it supposed to do run faster? Se