Multiple values in a single Table cell

Hello

I have a requirement of the customer. I need to show multiple values within a table cell

Example of

Location City Shop
NorthCity AHS-200, SH-210, SH310
SouthCity BSH - 100, SH341
EastCity CSH-20

But my table shows repeating cell as follows.

Location City Shop
NorthCity ASH-200
NorthCity ASH-210
NorthCity ASH310
SouthCity BSH-100
SouthCity BSH341
EastCity CSH-20

So I need your help to show repeated STORE name in a single column of the Table.

Thank you

Try this

EVALUATE_AGGR ('LISTAGG (%1, %2) within THE GROUP (ORDER BY DESC %3)', TableName.ColumnName, ',', TableName.ColumnName)

Tags: Business Intelligence

Similar Questions

  • Dreamweaver several graphs in single table cell

    Dreamweaver is having problems when I try to combine multiple charts in a single table cell. Some are separated by two end just "" entries, while others do not accept these separators. Pleas you show me the right way to handle this.

    Jack,

    • Tables should not be used for web page layouts.
    • Tables for tabular data such as spreadsheets and graphics only.
    • Today, we use an external CSS file for the layout, typography and other styles.

    Please show us what you are trying to do by copying and sticky code in a reply from the web forum.

    Nancy O.

  • Search for multiple values in a single field

    Hello

    I have this request to get results when the user doing a search query:

    select * from (
    select 
    "ID",
    "ID" ID_DISPLAY,
    "SHIFT_DATE",
    "SHIFT",
    "OFFENSE_ID",
    "DESCRIPTION",
    "ANALYST",
    "STATUS",
    "SUBSTATUS"
    from "#OWNER#"."IDSIEM_OFFENSES") 
    where
    OFFENSE_ID IN(:P223_OFFENSES) AND
    
     (
     instr(upper("DESCRIPTION"),upper(nvl(:P223_DESCRIPTION,"DESCRIPTION"))) > 0 
    )
    AND
    (
     instr(upper("SHIFT"),upper(nvl(:P223_SHIFT,"SHIFT"))) > 0 
    )
    AND
    (
     instr(upper("SUBSTATUS"),upper(nvl(:P223_SUBSTATUS,"SUBSTATUS"))) > 0 
    )
    AND
    (
     instr(upper("ANALYST"),upper(nvl(:P223_ANALYST,"ANALYST"))) > 0 
    )
    AND
    (
     instr(upper("SHIFT_DATE"),upper(nvl(:P223_SHIFTDATE,"SHIFT_DATE"))) > 0 
    )
    AND
    (
     instr(upper("STATUS"),upper(nvl(:P223_STATUS,"STATUS"))) > 0 
    )
    
    ORDER BY OFFENSE_ID DESC
    

    The thing I want to do is to set multiple values in the P223_OFFENSES field when I search. For example, an offence is a number, so I want to put in the search box 1111, 3333, 4444, 5555 and the report shows me these 4 offences in the report. The search operation only works when I put only 1 offences, but when I put more than 1, separated by commas, it gives me this error: error report: ORA-01722: invalid number. That is why, because is a number and the character point is not allowed, how can I achieve this? Thank you in advance.

    Best regards, Bernardo

    I solved a problem like this a few times with a utility function of pipeline for extracting the values from the list:

    CREATE or REPLACE TYPE split_tbl AS TABLE OF VARCHAR2 (32767).

    /

    FUNCTION to CREATE or REPLACE split_list

    (

    p_list VARCHAR2

    p_delimiter VARCHAR2: = ', '.

    ) Split_tbl RETURN

    PIPELINED IS

    l_idx PLS_INTEGER;

    l_list VARCHAR2 (32767): = p_list;

    BEGIN

    LOOP

    l_idx: = instr (l_list, p_delimiter);

    IF l_idx > 0

    THEN

    LINE of CONDUCT (substr (l_list, 1, l_idx - 1));

    l_list: = substr (l_list, l_idx + length (p_delimiter));

    ELSIF TRIM (l_list) IS NOT NULL

    THEN

    PIPE ROW (l_list);

    EXIT;

    ON THE OTHER

    EXIT;

    END IF;

    END LOOP;

    RETURN;

    END split_list;

    /

    In this way, you can define SQL like:

    SELECT to_number (column_value) FROM TABLE (split_list (' 1, 3, 99', ','))

    Or for this specific case: replace the condition

    OFFENSE_ID IN(:P223_OFFENSES)

    with

    OFFENSE_ID IN (SELECT to_number (column_value) FROM TABLE (split_list (: P223_OFFENSES, ',')))

    The advantage over using instr or regex is that you can usually always benefit index on OFFENSE_ID

    Better also to restrict entry to only numbers and ', ' or you will always get invalid numbers errors if a user enters "1234, 567, ABC"in the field of P233_OFFENSES.

    Kind regards

    Thierry

  • How to combine the large number of tables of pair key / value in a single table?

    I have a pair key / value tables of 250 + with the following features

    (1) keys are unique within a table but may or may not be unique in the set of tables
    (2) each table has about 2 million lines

    What is the best way to create a single table with all unique key-values of all these paintings? The following two queries work up to about 150 + tables
    with
      t1 as ( select 1 as key, 'a1' as val from dual union all
              select 2 as key, 'a1' as val from dual union all
              select 3 as key, 'a2' as val from dual )
    , t2 as ( select 2 as key, 'b1' as val from dual union all
              select 3 as key, 'b2' as val from dual union all
              select 4 as key, 'b3' as val from dual )
    , t3 as ( select 1 as key, 'c1' as val from dual union all
              select 3 as key, 'c1' as val from dual union all
              select 5 as key, 'c2' as val from dual )
    select coalesce(t1.key, t2.key, t3.key) as key
    ,      max(t1.val) as val1
    ,      max(t2.val) as val2
    ,      max(t3.val) as val3
    from t1
    full join t2 on ( t1.key = t2.key )
    full join t3 on ( t2.key = t3.key )
    group by coalesce(t1.key, t2.key, t3.key)
    /
    
    with
      master as ( select rownum as key from dual connect by level <= 5 )
    , t1 as ( select 1 as key, 'a1' as val from dual union all
              select 2 as key, 'a1' as val from dual union all
              select 3 as key, 'a2' as val from dual )
    , t2 as ( select 2 as key, 'b1' as val from dual union all
              select 3 as key, 'b2' as val from dual union all
              select 4 as key, 'b3' as val from dual )
    , t3 as ( select 1 as key, 'c1' as val from dual union all
              select 3 as key, 'c1' as val from dual union all
              select 5 as key, 'c2' as val from dual )
    select m.key as key
    ,      t1.val as val1
    ,      t2.val as val2
    ,      t3.val as val3
    from master m
    left join t1 on ( t1.key = m.key )
    left join t2 on ( t2.key = m.key )
    left join t3 on ( t3.key = m.key )
    /

    A couple of questions, then a possible solution.

    Why the hell you have 250 + tables pair key / value?

    Why the hell you want to group them in a table containing one row per key?

    You could do a pivot of all the tables, not part. something like:

    with
      t1 as ( select 1 as key, 'a1' as val from dual union all
              select 2 as key, 'a1' as val from dual union all
              select 3 as key, 'a2' as val from dual )
    , t2 as ( select 2 as key, 'b1' as val from dual union all
              select 3 as key, 'b2' as val from dual union all
              select 4 as key, 'b3' as val from dual )
    , t3 as ( select 1 as key, 'c1' as val from dual union all
              select 3 as key, 'c1' as val from dual union all
              select 5 as key, 'c2' as val from dual )
    select key, max(t1val), max(t2val), max(t3val)
    FROM (select key, val t1val, null t2val, null t3val
          from t1
          union all
          select key, null, val, null
          from t2
          union all
          select key, null, null, val
          from t3)
    group by key
    

    If you can do it in a single query, Union all 250 + tables, you don't need to worry about chaining or migration. It may be necessary to do this in a few passes, depending on the resources available on your server. If so, I would be inclined to first create the table, with a larger than normal free percent, making the first game as a right inset and other pass or past as a merger.

    Another solution might be to use the approach above, but limit the range of keys with each pass. So pass we would have a like predicate when the key between 1 and 10 in every branch of the union, pass 2 would have key between 11 and 20, etc. In this way, everything would be straight inserts.

    That said, I'm going back to my second question above, why the hell you want or need to do that? What is the company you want to solve. There could be a much better way to meet the requirement.

    John

  • How to select multiple values in a single field.

    Hi all

    I once select stmt as below

    ==================================

    SELECT msi.segment1,
    IN l_chr_omc_item
    OF SGM_INV_ITEM_ATTRIBUTES SIIA, msi mtl_system_items
    WHERE msi.inventory_item_id = siia.inventory_item_id
    AND siia.attribute12 = l_chr_tsb_item;

    ======================================

    I need to print some l_chr_omc_item, but if the above query retrieves multiple values of the l_chr_omc_item for a l_chr_tsb_item so I need to print all the values. How to get all these values in a single rank.
    Thanks in advance.

    Published by: Shivaji M on June 28, 2009 23:18

    Published by: Shivaji M on June 28, 2009 23:27

    cursor curGetxx (inpl_chr_tsb_item in SGM_INV_ITEM_ATTRIBUTES.attribute12%type)
    is
    SELECT
    MSI. Segment1
    Of
    SGM_INV_ITEM_ATTRIBUTES SIIA
    msi mtl_system_items
    WHERE msi.inventory_item_id = siia.inventory_item_id
    AND siia.attribute12 = inpl_chr_tsb_item;

    l_chr_omc_item SGM_INV_ITEM_ATTRIBUTES.attribute12%type;
    vStrl_chr_omc_item varchar (500);

    Start
    Open curGetxx (l_chr_tsb_item);
    loop
    extract the curGetxx in l_chr_omc_item;
    When the output curGetxx % NOTFOUND;
    vStrl_chr_omc_item: = concat (l_chr_omc_item, ',')
    dbms_output.put_line (l_chr_omc_item);
    end loop;
    vStrl_chr_omc_item: = substr (vStrl_chr_omc_item, 1, length (vStrl_chr_omc_item)-1);
    end;
    /

  • Assign a value to a populated table cell [in BULK]

    Hi all
    I have a problem by assigning a value to a populated table to COLLECT LOOSE .
    I can reproduce the problem with this
    CREATE TABLE TEST_TABLE (
    value1 NUMBER,
    value2 NUMBER
    );
    
    INSERT INTO test_table VALUES(1,1);
    INSERT INTO test_table VALUES(1,1);
    INSERT INTO test_table VALUES(1,1);
    INSERT INTO test_table VALUES(1,1);
    INSERT INTO test_table VALUES(1,1);
    INSERT INTO test_table VALUES(1,1);
    INSERT INTO test_table VALUES(1,1);
    INSERT INTO test_table VALUES(1,1);
    INSERT INTO test_table VALUES(1,1);
    INSERT INTO test_table VALUES(1,1);
    And it's the anonymous PL/SQL block that gives me problems:
    DECLARE
      SUBTYPE t_rec IS TEST_TABLE%ROWTYPE;
    TYPE records_table IS TABLE OF t_rec;
      elist RECORDS_TABLE;
      CURSOR table_cursor IS SELECT * FROM TEST_TABLE WHERE rownum <= 20;
    BEGIN
      OPEN table_cursor;
      FETCH table_cursor BULK COLLECT INTO elist;
        FOR j IN 1..elist.COUNT
        LOOP
          elist(j)(1) := elist(j)(1) +1;
        END LOOP;
      CLOSE table_cursor;
    END; 
    The error is
    ORA-06550: line 13, column 7:
    PLS-00308: this construct is not allowed as the origin of an assignment
    ORA-06550: line 13, column 7:
    PL/SQL: Statement ignored
    06550. 00000 -  "line %s, column %s:\n%s"
    *Cause:    Usually a PL/SQL compilation error.
    *Action:
    So they do not compile because of this line of code:
    enclose (j) (1): = enclose (j) (1) + 1;

    Why it does not work?

    If I try to do, works perfectly:
    DECLARE
    TYPE v_num_table
    IS
      TABLE OF NUMBER;
    TYPE v_2_num_table
    IS
      TABLE OF v_num_table;
      v_nums V_2_NUM_TABLE := V_2_NUM_TABLE();
    BEGIN
      v_nums.EXTEND;
      v_nums(1) := v_num_table();
      v_nums(1).EXTEND;
      v_nums(1)(1) := 1;
      v_nums(1)(1) := v_nums(1)(1) +1;
      dbms_output.put_line(v_nums(1)(1) );
    END;
    Published by: user10396517 on 2.35 2-mar-2012

    Variable "enclose" is an archival collection, so access you an individual field of an element of the given collection by specifying the domain name, not its position:

    DECLARE
      SUBTYPE t_rec IS TEST_TABLE%ROWTYPE;
      TYPE records_table IS TABLE OF t_rec;
      elist RECORDS_TABLE;
      CURSOR table_cursor IS SELECT * FROM TEST_TABLE WHERE rownum <= 20;
    BEGIN
      OPEN table_cursor;
      FETCH table_cursor BULK COLLECT INTO elist;
        FOR j IN 1..elist.COUNT
        LOOP
          elist(j).value1 := elist(j).value1 + 1;
        END LOOP;
      CLOSE table_cursor;
    END;
    

    Your second example is different because you are dealing with a collection of collections.

  • Left join of the two tables and multiple values into a single value separated by commas

    Hello

    I have following tables with their structures and their data as below.

    CREATE TABLE 'BETODI '. "" BETINFO ".

    (

    VARCHAR2 (8 BYTE) "CURRENTPRESS."

    ENABLE 'TYPEIDCONTAINER' VARCHAR2 (30 BYTE) NOT NULL

    )

    INSERT INTO Betinfo (Currentpress, typeidcontainer) VALUES ('A24G', 'PMC');

    INSERT INTO Betinfo (Currentpress, typeidcontainer) VALUES ('A24D', 'Pensky-MARTENS');

    INSERT INTO Betinfo (Currentpress, typeidcontainer) VALUES ("A25D", "CMP");

    INSERT INTO Betinfo (Currentpress, typeidcontainer) VALUES ('A25G', 'PMC');

    INSERT INTO Betinfo (Currentpress, typeidcontainer) VALUES ('A26D', 'PMC');

    INSERT INTO Betinfo (Currentpress, typeidcontainer) VALUES ('A26G', 'PMC');

    INSERT INTO Betinfo (Currentpress, typeidcontainer) VALUES ("A32G", "V-BFC3");

    INSERT INTO Betinfo (Currentpress, typeidcontainer) VALUES ('A32D', "V-BFC2");

    CREATE TABLE 'BETODI '. "" BETMASTER ".

    (

    ACTIVATE THE "CUREPRESS" TANK (5 BYTES) NOT NULL,

    ACTIVATE THE "TYPE" VARCHAR2 (5 BYTE) NOT NULL,

    NUMBER (5.0) "LASTPCIRIM".

    )

    INSERT INTO BetMaster (Curepress, type, lastpcirim) VALUES ('A24', '45 M 8', 15);

    INSERT INTO BetMaster (Curepress, type, lastpcirim) VALUES ('A25', 42 16', 15);

    INSERT INTO BetMaster (Curepress, type, lastpcirim) VALUES ("A26", 16' 45, 15);

    INSERT INTO BetMaster (Curepress, type, lastpcirim) VALUES ("A27", '45 M 34', 16);

    INSERT INTO BetMaster (Curepress, type, lastpcirim) VALUES ('A28', '45 M 34', 16);

    INSERT INTO BetMaster (Curepress, type, lastpcirim) VALUES ('A29', '45 M 34', 16);

    INSERT INTO BetMaster (Curepress, type, lastpcirim) VALUES ('A30', '45MCH', 15);

    INSERT INTO BetMaster (Curepress, type, lastpcirim) VALUES ("A31", "45MCH", 16);

    INSERT INTO BetMaster (Curepress, type, lastpcirim) VALUES ('A32', '45MCH', 16);

    INSERT INTO BetMaster (Curepress, type, lastpcirim) VALUES ('A33', '45MCH', 16);

    INSERT INTO BetMaster (Curepress, type, lastpcirim) VALUES ("A34", "45MCH", 16);

    These two tables have left join as

    BETMASTER. CUREPRESS = substr (BETINFO. CURRENTPRESS, 1, 3)

    now I want to have the data in the two tables with fields Curepress, Lastpcirim, typeidcontainer.

    Also something like

    Make a group of typeidcontainer if this value is greater than 1 by press separated the values of semicolon (;)

    So, for example above, we should be given as

    A24 PMC 15; PENSKY-MARTENS

    A25 15 PMC

    A26 15 PMC

    A27 16 (NULL)

    A28 16 (NULL)

    A30 15 (NULL)

    A31 16 (NULL)

    A32 16 BFC2-V; V BFC3

    A33 16 (NULL)

    A34 16 (NULL)

    How could do?

    My current request is as

    Select distinct Curepress, lastpcirim, typeidcontainer

    BETMASTER STD left join INF BETINFO

    on the trim (STD. CUREPRESS) = substr (trim (INF. CURRENTPRESS), 1, 3)

    but I am unable to get the values separated by commas.

    Any help would be appreciated.

    Thank you

    Mahesh.

    Hi, Mahesh,

    If you want to only 1 row of output for each distinct combination of currentpress and lastpcirim?  This sounds like a job for GROUP BY.

    And you want the row to contain a list of all different typidcontainers-delimited?  This sounds like a job for the aggregate LISTAGG function.

    WITH joined_data AS

    (

    SELECT DISTINCT

    MST.curepress, mst.lastpcirim, inf.typeidcontainer

    OF betmaster STD

    LEFT JOIN betinfo ON TRIM (mst.curepress) inf = SUBSTR (TRIM (inf.currentpress)

    1

    3

    )

    )

    SELECT curepress, lastpcirim

    LISTAGG (typeidcontainer, ',')

    THE Group (ORDER BY typeidcontainer) AS container_list

    OF joined_data

    Curepress GROUP, lastpcirim

    ;

    Unfortunately, you can't say LISTAGG (DISTINCT ...), so you should always get the separate containers how you already are.  (Note that the subquery is just what you posted).

    Thanks for posting the CREATE TABLE and INSERT statements; It is very useful.  Don't forget to tell what version of Oracle you are using.  LISTAGG was new in Oracle 11.2.

    Why not add CHECK constraints (and perhaps triggers) to your tables, so that curepress and currentpress are not stored with the head or trailing spaces?  Then you wouldn't need to use the PAD in queries like this, and your code would be simpler and more effective.

  • How to pass multiple values in a single parameter

    Hi all

    I have a setting in my report called dept, this setting takes values in a list. I am using a sql query to populate the list. then the values available for dept are HR, FINANCE, MARKETING.

    In the setting column, I checked the option "MULTIPLE SÉLECTION" AND "CAN SELECT ALL" and I select "all THE VALUES PASSED.

    Now my data model sql looks like

    Select * from emp where Department: dept

    When I try to view the report and select ALL the list of values I don't get any results out of it. In short, I want to run my query for all values of the Department and I want that this query to run when I select ALL from the list.

    Select * from emp where Department ('HR', 'FINANCE', 'MARKETING')

    But I don't get all the data, is it passing null? How to solve this?

    Any help will be really appreciated

    Thank you
    Ronny

    You can change the code to sql data model looks like

    select * from emp where department in (:dept )
    
  • Join the properties of multiple objects in a single table

    I need to scroll through a host group and display a report with a handful of properties that I can display them in a row with each host.  These properties are visible in the Configuration-> tab networking to an ESXi host.  I would like to see something like this:

    PORT SPEED DUPLEX VSWITCH VMNIC HOST GROUP

    management of true vswitch0 vmnic0 1000 host01

    management of true vswitch0 vmnic1 1000 host01

    host01 vmnic2 1000 vswitch1 true vmotion

    host01 vmnic3 1000 vswitch1 true vmotion

    host01 vmnic4 1000 vswitch2 true vmprod

    host01 vmnic5 1000 vswitch1 true vmprod

    host01 vmnic6 1000 true vswitch3 backup

    host01 vmnic7 1000 true vswitch3 backup

    management of true vswitch0 vmnic0 1000 host02

    etc...

    I think that is relatively simple, but I can't wrap my brain around how properly analyze objects in order to accomplish this.  I was looking at the properties of the different methods, and I think that the information required to extract these cmdlets with the properties listed after them:

    Get-VMHostNetworkAdapter - DeviceName, BitRatePerSec, FullDuplex

    Get-VirtualSwitch - name, Nic

    Get-VirtualPortGroup - name, VirtualSwitch

    It seems that there should be a way to include the results of Get-VMHostNetworkAdapter and Get-VirtualSwitch using the "Device Name" and "Nic" properties respectively and include the results of Get-VirtualSwitch and Get-VirtualPortGroup, by using the properties of 'Name' and "VirtualSwitch" respectively.  I have just not quite now how to gather all this information.

    Thanks for your suggestions.

    \/\ike


    For undistributed switches you can do like this

    foreach($esx in Get-VMHost){
        foreach($vsw in (Get-VirtualSwitch -VMHost $esx | where {$_.ExtensionData.GetType().Name -ne "DistributedVirtualSwitch"} ) ){
            foreach($pg in Get-VirtualPortGroup -VirtualSwitch $vsw){
                $pnics = $esx.ExtensionData.Config.Network.Pnic | where {$vsw.ExtensionData.Pnic -contains $_.Key}
                $pg | Select @{N="Host";E={$esx.Name}},
                    @{N="pnic";E={[string]::Join(',',($pnics | %{$_.Device}))}},
                    @{N="Speed";E={[string]::Join(',',($pnics | %{$_.LinkSpeed.SpeedMb}))}},
                    @{N="Duplex";E={[string]::Join(',',($pnics | %{$_.LinkSpeed.Duplex}))}},
                    @{N="vSwitch";E={$vsw.Name}},
                    @{N="Portgroup";E={$pg.Name}}
    
            }
        }
    }
    
  • How ins or upd multiple values in a record of diff of the fields by using the cursor

    Hai All

    I need to insert or update or multiple values in a single diff of one field records to another table.

    Table 1 has 3 fields

    Bartime bardate barcode

    02/01/10 0011, 0815

    02/01/10 0022, 0820

    02/01/10 0011, 1130

    02/01/10 0022, 1145

    02/01/10 0011, 1230

    02/01/10 0022, 1235

    02/01/10 0011, 1645

    02/01/10 0022, 1650


    These are the times that arrives at 0815 and pauses at 1130 and arrives at 12: 30 a.m. and coming home at 4:45 pm
    These table I have to insert into another table called table2
    and the fields are bar codes, date, intrinsically timein, introut, tiomout

    And the output you want to like this

    barcode timein intrinsically introut timeout date
    0011 0815 1130 1230 1645 02/01/10

    0022 0820 1145 1235 1650 02/01/10

    If all give some good answer that it will be help full...

    Thanks and greetings

    Srikkanth.M

    Hi Srikanth,

    1. first create a datablock (better do instead of the table because its only for querying details of table 1 for the period) with table1 as table base and better use order by clause in form as "order to barcode, date, bartime.

    2. create a second datablock with table2 and get this rank on the two table (second block as base table, because here, you should insert/update)

    now on the screen you can see all the data in 2 tables.

    3. fix the button of some process.

    a time-but-press

    Loop

    1 block of travel and take a line

    Find the same block 2

    If code in bars-avail so
    -you want to update
    on the other
    -you want to insert

    end if;

    end of loop

    and 2nd block will be updated / inserted as u desire, and finally, you can save the second block.

    Iqbal

  • How do I insert or update multiple values in a field of diff files

    Hai All

    I need to insert or update or multiple values in a single diff of one field records to another table.


    Table 1 has 3 fields

    Bartime bardate barcode

    02/01/10 0011, 0815

    02/01/10 0022, 0820

    02/01/10 0011, 1130

    02/01/10 0022, 1145

    02/01/10 0011, 1230

    02/01/10 0022, 1235

    02/01/10 0011, 1645

    02/01/10 0022, 1650


    These are the times that arrives at 0815 and pauses at 1130 and arrives at 12: 30 a.m. and coming home at 4:45 pm
    These table I have to insert into another table called table2
    and the fields are bar codes, date, intrinsically timein, introut, tiomout

    And the output you want to like this

    barcode timein intrinsically introut timeout date
    0011 0815 1130 1230 1645 02/01/10

    0022 0820 1145 1235 1650 02/01/10

    If all give some good answer that it will be help full...

    Thanks and greetings

    Srikkanth.M

    Try like this

    with t
    as
    (
    select '0011' barcode,to_date('01-02-10','dd-mm-yy') bardate,'0815' bartime from dual union all
    select '0022',to_date('01-02-10','dd-mm-yy'),'0820' from dual union all
    select '0011',to_date('01-02-10','dd-mm-yy'),'1130' from dual union all
    select '0022',to_date('01-02-10','dd-mm-yy'),'1145' from dual union all
    select '0011',to_date('01-02-10','dd-mm-yy'),'1230' from dual union all
    select '0022',to_date('01-02-10','dd-mm-yy'),'1235' from dual union all
    select '0011',to_date('01-02-10','dd-mm-yy'),'1645' from dual union all
    select '0022',to_date('01-02-10','dd-mm-yy'),'1650' from dual
    )
    select barcode,
           bardate,
           max(decode(rno, 1, bartime)) timein,
           max(decode(rno, 2, bartime)) interin,
           max(decode(rno, 3, bartime)) interout,
           max(decode(rno, 4, bartime)) timeout
      from (select barcode,
                   bardate,
                   bartime,
                   row_number() over(partition by barcode, bardate order by to_date(bartime,'hh24:mi')) rno
              from t)
     group by barcode, bardate
    
  • ERROR: The specified parameter 'Rental' expects a single value, but your name criteria "PROD" corresponds to multiple values.

    Hello

    I am writing a script to create the new VM (base clone of a virtual machine) in a specific folder.

    When you run the script, I get an error:

    The specified parameter 'Rental' expects a single value, but your name criteria "PROD" corresponds to multiple values.

    Some research led me to a post of 2011, which describes the same error. The only thing is, I can find no trace of open connection and then a more...

    What I tried:

    I run the script on the server for vSphere, so I closed the open vSphere client.

    closing ('disconnect-viserver") all existing connections in the first line of the script-> an error because no connection is open.

    In several places in the script, add the following lines:

    ECHO ' - '.

    $DefaultVIServers <-as noted in the post of 2011

    ECHO ' - '.

    This shows that no connection is open until I do the "connect-viserver", subsequently, apparently, that a connection is established.

    the results and the (current) script are found in the files to attach.

    I also found an error on the "set-PowerCLIConfiguration that I can't explain.

    One last question... Is there a possibility to have the new virtual machine created through 3 hosts? the first on the first host, the second on the second, the third on the third, the fourth back on the first host,... and so on?

    Any help would be appreciated.

    Thank you.

    Johan

    Of course, you can provide the full path, for example see my post of folder by Path .

  • How to select all text in a table with a single click cell?

    How to select all text in a table with a single click cell? I use TextField.selectAll () when you implement a table cell factory. But when I select a line with a single click, then a click on a table cell again: see the result image

    The text in the table cell is not all selected. What I simply selects all the text in a table cell when there is a click on it. How to realize that? Thank you

    Thanks for help ~.

  • value of multiple line in a single row (nclob)

    Hello
    I have a requirement where I have to work on a nclob data type column, now here the value of 2 lines in a single column. Like this:

    Select extractvalue (xmltype (details), '/ Anything/invoiceNumber') separate as invoices,
    actinguserid as user_id, createdt
    of bchistevent where bucket = 201301
    and upper (type) = ' COM. AVOLENT. PRESENTATION. EVENT. INVOICEDOWNLOADEVENT'
    - and bchistevent.bucket = to_char (add_months (sysdate-1), "YYYYMM")

    000-395452969-20130103 1.46388193452398E37 08/01/2013 03:05:42
    300000590-000-20090723 1.46388193452398E37 11/01/2013 08:11:45
    300000590-000-20090723 1.46388193452398E37 11/01/2013 08:12:50
    000-395453127-20130103 1.46388193452398E37 14/01/2013 04:44:26
    * 300084670-000-20120906, 300084671-000-20120906 * 1.46388193452398E37 07/01/2013 12:45:19 AM
    000-395452626-20130103 1.46388193452398E37 08/01/2013 03:03:57
    000-300084679-20120906-1.46388193452398E37 11/01/2013 08:10:47
    300000728-000-20090731 1.46388193452398E37 11/01/2013 08:19:19
    000-300084679-20120906 1.46388193452398E37 14/01/2013 12:31:48 AM
    300000590-000-20090723 1.46388193452398E37 14/01/2013 04:13:19
    000-395452718-20130103 1.46388193452398E37 08/01/2013 07:10:19
    000-300084679-20120906 1.46388193452398E37 23/01/2013 06:54:11
    000-300084679-20120906 1.46388193452398E37 22/01/2013 03:11:54
    300000590-000-20090723 1.46388193452398E37 11/01/2013 08:14:02
    000-395453127-20130103 1.46388193452398E37 14/01/2013 04:33:12
    000-300084679-20120906 1.46388193452398E37 22/01/2013 03:03:36
    000-300084679-20120906 1.46388193452398E37 14/01/2013 12:34:13 AM
    000-395452997-20130103 1.46388193452398E37 07/01/2013 03:31:38
    000-395452391-20121027 1.46388193452398E37 03/01/2013 04:40:05

    and the value of the "BOLD" highlighted line is coming in a single line, please help how to break this in 2 rows?

    Published by: user1175303 on March 13, 2013 05:43

    user1175303 wrote:
    the value of the column that is involved is 300084670-000-20120906, 300084671-000-20120906 here I get 2 values in a single column, and for this reason, I am unable to get the desired result.

    If you have XML question but try to solve in Oracle? Why is the owner of two invoice numbers? In any case:

    with t as (
               select  distinct extractvalue(xmltype(details),'/Anything/invoiceNumber') as invoices,
                       actinguserid as user_id,
                       createdt
                 from  bchistevent
                 where bucket = 201301
                   and upper(type) = 'COM.AVOLENT.PRESENTATION.EVENT.INVOICEDOWNLOADEVENT'
              )
    select  regexp_substr(invoices,'[^,]+',1,column_value) invoices,
            user_id,
            createdt
      from  t,
            table(
                  cast(
                       multiset(
                                select  level
                                  from  dual
                                  connect by level <= length(regexp_replace(invoices,'[^,]')) + 1
                               )
                       as sys.OdciNumberList
                      )
                 )
    /
    

    SY.

  • "expects a single value / corresponds to multiple values" error script New - vm in PowerCLI

    I have been responsible for creating some 800 + virtual desktops so, naturally, this is something I want to script.  After reading through the large bases of knowledge here, I was able to create what I thought, it was the correct code.  It worked when I was just "write-host" ing lines command to see if the variable creation/uasge worked well.  When I removed the lines of write-host and tried to use the actual orders new-vm, I started having different "of the specified parameter '$vmhost' expects only one value, but your criteria of name ' xxx - vm53.yyyyyyyyy.com' correspondingponds to several values." errors.  Here is my code, marked specificities:

    Add-PSSnapin VMWare.VimAutomation.Core # PowerCli add script environmen t
    $creds = get-vicredentialstoreitem-'c:\temp\credfile.xml' # chopped access file password to authentice with "sys" service account from the file
    connect-viserver-Server $creds.host-$creds.user username-password $creds.password
    $host1 = get-cluster "HVD1" | get-vmhost | Tri-objet "memoryusagemb" | Select-object - 1 first | foreach {$_.name} # get the VMWare hosts with less use of the memory of the cluster host "HVD1" registration
    $dstore = get-datastore ' vdi_ * ' | Tri-objet 'FreeSpaceMB' - descending | Select-object - 1 first | foreach {$_.name} # Get datastore disk with most freespace to be VDI_ *
    $VMBaseName = "XX-P01-HVD" # definition of trade names XenDesktop hosted
    $Template = get-model model-CBD-XD-XP | Select-object - 1 first | foreach {$_.name} # Setting for XenDesktop hosted Commercial model
    $OSCustSpec = "CBD - XD XP" hosted # Setting for hosted Commercial XenDesktop customization script
    $loc = 'Desktop' # configuration for XenDesktop folder
    $ResPool = get-resourcepool XX-P01-HVD | Select-object - 1 first | foreach {$_.name} # XenDesktop hosted Commercial resource pool setting
    [int] $FirstNumber = 0
    [int] $HostTotal = 0
    [int] $ctr = 0

    $FirstNumber = Read-Host "enter the first digit to the VMWare host range".
    $HostTotal = Read-Host "enter the quantity for the VMWare host range".
    $HostNumber = $FirstNumber
    $HostFinal = $HostNumber + $HostTotal

    do {}
    $vmname = $vmbasename + $HostNumber
    new-vm - vmhost $host1-name $VMName - $ResPool - $loc location ResourcePool - datastore - slim - DiskStorageFormat $dstore model $template - OSCustomizationspec $OSCustSpec # Execute the new VMWare host creation
    Start-vm $VMName # start the virtual machine to start the customization process
    $HostNumber ++
    $ctr += 1
    If ($ctr - eq 5) {write-host write-host "break 10 Minutes' sleep s 600; $ctr = 0; write-host} # sleep for 600 seconds every 5 VMs to avoid overloading ESX hosts
    } until ($HostNumber - eq $HostFinal)

    Here are my mistakes:


    New - VM: 23/03/2011-17:42:22 new-VM parameter specified "VMHost.
    expects a single value, but your criteria of name ' xxx - vm53.yyyyyyyyy.com' corresponding
    ponds to multiple values.
    To C:\temp\xx_deploy.ps1:31 character: 7
    + new-vm < < < <-vmhost $host1-name $VMName - $ResPool - $l location ResourcePool
    OC - datastore - slim - DiskStorageFormat $dstore model $template - OSCustomizat
    creating # ionspec $OSCustSpec of the new VMWare host Execute
    + CategoryInfo: InvalidResult: (System.Collecti... dObjectInterop)
    (]: List 1) [new-VM], VimException
    + FullyQualifiedErrorId: Core_ObnSelector_SelectObjectByNameCore_MoreResu
    ltsThanExpected, VMware.VimAutomation.ViCore.Cmdlets.Commands.NewVM

    New - VM: 23/03/2011-17:42:23 new-VM parameter specified ' Resourc
    ePool' expects a single value, but your name criteria is "XX-P01-HVD.
    multivalued.
    To C:\temp\xx_deploy.ps1:31 character: 7
    + new-vm < < < <-vmhost $host1-name $VMName - $ResPool - $l location ResourcePool
    OC - datastore - slim - DiskStorageFormat $dstore model $template - OSCustomizat
    creating # ionspec $OSCustSpec of the new VMWare host Execute
    + CategoryInfo: InvalidResult: (System.Collecti... dObjectInterop)
    (]: List 1) [new-VM], VimException
    + FullyQualifiedErrorId: Core_ObnSelector_SelectObjectByNameCore_MoreResu
    ltsThanExpected, VMware.VimAutomation.ViCore.Cmdlets.Commands.NewVM

    New - VM: 23/03/2011-17:42:23 new-VM parameter ResourcePool: could not
    t find any object specified by its name.
    To C:\temp\xx_deploy.ps1:31 character: 7
    + new-vm < < < <-vmhost $host1-name $VMName - $ResPool - $l location ResourcePool
    OC - datastore - slim - DiskStorageFormat $dstore model $template - OSCustomizat
    creating # ionspec $OSCustSpec of the new VMWare host Execute
    + CategoryInfo: ObjectNotFound: (VMware.VimAutom, ol ResourcePo)
    OL:RuntimePropertyInfo) [new-VM], ObnRecordProcessingFailedException
    + FullyQualifiedErrorId: Core_ObnSelector_SetNewParameterValue_ObjectNotF
    oundCritical, VMware.VimAutomation.ViCore.Cmdlets.Commands.NewVM

    I had multiple values for some of the entries, that's why I tried to analyze with the first '-1' and outside the script, the values return very well.

    Any help?

    And this is the cause of the problem.

    You feed the New - VM name in fact only 1, and the cmdlet, by OBN, tries to resolve the name into an object.

    But since there are 2 connections, it will get an object returned by each connection.

    Where the multiple value message.

    Check if you have several Connect-VIServers in the script and maybe close all connections before the script starts.

    Or switch to simple mode with the Set-PowerCLIConfiguration cmdlet.

Maybe you are looking for

  • can I pay my monthly net flex with gift cards

    can I pay my monthly net flex with iTunes gift cards

  • Toshiba L 40, 7335 does not start

    I have a Toshiba smart l7335, that it does not start. At the beginning the indication led starts green and at the end of 2-5 seconds looking past automatically mode and indicator led turns red. The screen seems to be turned on but no signal at all or

  • Help improve llb of Labview 5.1 to 7.1

    Hello guys and girls, I have a serial.llb works very well with labview 5.1, and I've updated my version of labview 7.1, when I open the Serial.llb using labview 7.1 to upgrade, open, but the removal of the program many features making it the screw wo

  • How to stop the e.mails of undisclosed recipients

    How to stop e.mails of undisclosed recipients

  • How to reuse stringBuffer...

    I have this: StringBuffer sb = null;String value; Loop{ value = g4ttu6n; sb = new StringBuffer(value);....Send(sb);} And I wondered: is there a way to do something like this: String value; StringBuffer sb = new StringBuffer(value); Loop { value = grf