Help multiple value parameter, pl/sql

Hi all

I have a pl/sql as procedure:

operating (pi_id varchar2);

If I pass values for pi_id like 'a, b, c, d, a3, a100';

In this procedure, I have something like:

The code of the 1 'a' I need to make a treatment for this id
For the 2nd id, 'b', I need to do the same treatment for different id
.
.
. (so on)
If 100th value('a100') then the same different treatment for id.

How can I break the varchar 'a, b, c, d, a3, a100' in different id and the treatment for each id (just similar to the works of a cursor)?

In detail:

create or replace procedure test (pi_id varchar2) is

Start

Dbms_output.put_line (pi_id);

end;

This will display: a, b, c, d, a3-a100

I want the output to be like (printed at the same time not the next line print):
one
b
c
d
A3
A100

Thank you
Verdier

Published by: Verdier on February 5, 2011 18:51

Watch http://asktom.oracle.com/pls/asktom/f?p=100:11:0:P11_QUESTION_ID:73830657104020 (no tables involved)

Concerning

Etbin

Tags: Database

Similar Questions

  • Dynamic action with multiple values of PL/SQL Expression as a condition

    Hel

    I am currently using Apex 4.0 for a schoolproject.

    I have two selectlists (P8_BUSINESSRULETYPE - which has al businessruletypes) and (P8_OPERATOR) that has a select statement based on the businessruletype.

    I want to hide the selectlist operator when P8_BUSINESSRULETYPE = 7,8,9 and 10 or P8_OPERATOR = 9

    When: change

    SelectionType article (s)

    Elements P8_BUSINESSRULETYPE

    condition: equal to 10

    Real actions: hide items p8_operator

    False actions: show p8_operator items

    ConditionType PL/SQL EXPRESSION

    : P8_BUSINESSRULETYPE = 10 OR: P8_BUSINESSRULETYPE = 8 OR: P8_BUSINESSRULETYPE = 7 OR: P8_BUSINESSRULETYPE = 9

    What is the problem with my dynamic action? Because he does not hide the operatorfield when businessruletype 10 or 9 are selected in the selectlist. Sessions has also said operator = 9 and Businessruletype = 10

    I hope you guys can help out me.

    Thank you very much.

    2843640 wrote:

    Please update your forum profile with a real handle instead of '2843640 '.

    I am currently using Apex 4.0 for a schoolproject.

    I have two selectlists (P8_BUSINESSRULETYPE - which has al businessruletypes) and (P8_OPERATOR) that has a select statement based on the businessruletype.

    I want to hide the selectlist operator when P8_BUSINESSRULETYPE = 7,8,9 and 10 or P8_OPERATOR = 9

    When: change

    SelectionType article (s)

    Elements P8_BUSINESSRULETYPE

    condition: equal to 10

    Real actions: hide items p8_operator

    False actions: show p8_operator items

    ConditionType PL/SQL EXPRESSION

    : P8_BUSINESSRULETYPE = 10 OR: P8_BUSINESSRULETYPE = 8 OR: P8_BUSINESSRULETYPE = 7 OR: P8_BUSINESSRULETYPE = 9

    What is the problem with my dynamic action? Because he does not hide the operatorfield when businessruletype 10 or 9 are selected in the selectlist. Sessions has also said operator = 9 and Businessruletype = 10

    The first thing is that a Condition that is applied to a control of dynamic action if the dynamic action is made the see page. She has therefore no impact on the question of whether the actions of true or false are performed. Control conditions which are those defined in the when the properties of the dynamic action. As they are evaluated in the browser, they must be specified as JavaScript.

    Secondly, this expression is not valid because it is a space between the colon and the identifiers. Link the names of rating, the colon and the variable element must be contiguous:

    :P8_BUSINESSRULETYPE = 10 OR :P8_BUSINESSRULETYPE = 8  OR :P8_BUSINESSRULETYPE = 7 OR :P8_BUSINESSRULETYPE = 9
    

    However the latter is only of academic interest, in this case you need to remove the condition of dynamic action.

    In the dynamic of change when action section, P8_BUSINESSRULETYPE, P8_OPERATOR, Condition of JavaScript Expressionand value to the value of the item (s)

       ($v('P8_BUSINESSRULETYPE') == '7')
    || ($v('P8_BUSINESSRULETYPE') == '8')
    || ($v('P8_BUSINESSRULETYPE') == '9')
    || ($v('P8_BUSINESSRULETYPE') == '10')
    || ($v('P8_OPERATOR') == '9')
    

    If you are using a browser that supported, this can be simplified to

       (['7', '8', '9', '10'].indexOf($v('P8_BUSINESSRULETYPE')) >= 0)
    || ($v('P8_OPERATOR') == '9')
    
  • What subprogramme should we prefer to return multiple values with OUT parameter?

    Hello

    I worked on the procedures and functions, and aware of their differences. Today I have an interview question that - suppose I don't have return multiple values through a subroutine and I want nor run any what DML within this subprogramme and I want to use this subprogramme in the SQL query. What subprogramme I would prefer - "Operating Mode" or "Function" and why?

    In my view, both can be used in this case, but want to see your views and opinions.

    Kind regards

    Sachin jerbi

    In terms of software engineering, if you claim something that you expect to "return" something (a value or values) then you use a function.  If you call something to "do" something, and then you use a procedure.

    THE settings are not good practices in many cases and should not strictly considered "return" of values.  Instead, they are assigned values in the code and generally act as pointers to the original variable/structure that was passed as a parameter (the actual internals of Oracle don't quite do it, but in principle this is what they do).

    A return value (or structure) of a function is basically push in the battery to the point that the RETURN statement is issued, and then the code calling the stack appears to assign it to a variable or placeholder, it should go in.

    If it seems a little difference between procedures and functions to some people, it is recommended to use functions for obtaining values and procedures to do things, in most cases.  It is not just "syntactic sugar", as mentioned above.

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

  • Spend multiple values with parameter of stored procedure

    CREATE TABLE VTEST_INSERT)

    NUMBER OF MY_ID,

    COLUMN1 VARCHAR2 (50)

    );

    -SELECT * FROM VTEST_INSERT;

    INSERT INTO VTEST_INSERT (MY_ID, COLUMN1) VALUES (1, 'TEST1');

    INSERT INTO VTEST_INSERT (MY_ID, COLUMN1) VALUES (2, "TEST2");

    INSERT INTO VTEST_INSERT (MY_ID, COLUMN1) VALUES (3, "TEST3");

    INSERT INTO VTEST_INSERT (MY_ID, COLUMN1) VALUES (4, "TEST4");

    INSERT INTO VTEST_INSERT (MY_ID, COLUMN1) VALUES (5, 'TEST5');

    INSERT INTO VTEST_INSERT (MY_ID, COLUMN1) VALUES (1, "TEST6");

    INSERT INTO VTEST_INSERT (MY_ID, COLUMN1) VALUES (2, 'TEST7');

    INSERT INTO VTEST_INSERT (MY_ID, COLUMN1) VALUES (3, "TEST8");

    INSERT INTO VTEST_INSERT (MY_ID, COLUMN1) VALUES (4, 'TEST9');

    INSERT INTO VTEST_INSERT (MY_ID, COLUMN1) VALUES (5, "TEST10");

    CREATE OR REPLACE

    PROCEDURE VTEST_INSERT_SP (vid in VARCHAR2, vname IN VARCHAR2)

    AS

    BEGIN

    DELETE FROM VTEST_INSERT WHERE MY_ID IN (vid);

    INSERT INTO VTEST_INSERT (MY_ID, COLUMN1) VALUES (vid, vname);

    END;

    /

    EXEC VTEST_INSERT_SP(1,'TEST999');

    This set works well above. But I want to be able to pass multiple values VNAME. so, something like:

    EXEC VTEST_INSERT_SP(1,'TEST999','TEST888','TEST777');

    any help is appreciated. Thank you.

    This would make many inserts each with the same vid and values of different VNAME.

    Try something like this

    1. SET SQLBLANKLINES
    2. ALTER SESSION SET PLSQL_WARNINGS = ' ENABLE: ALL ';
    3. DROP TABLE vtest_insert;
    4. CREATE TABLE vtest_insert (vid NUMBER, vname VARCHAR2 (20));
    5. INSERT ALL
    6. IN vtest_insert (vid, vname) VALUES (1, "yyyy")
    7. IN vtest_insert (vid, vname) VALUES (1, "bb")
    8. IN vtest_insert (vid, vname) VALUES (1, "cccccc")
    9. IN vtest_insert (vid, vname) VALUES (2, "ddd")
    10. IN vtest_insert (vid, vname) VALUES (2, 'ee')
    11. SELECT * FROM .dual 'PUBLIC '.
    12. SELECT * FROM vtest_insert;
    13. CREATE or REPLACE TYPE vnames_tab_ty IS TABLE OF VARCHAR2 (20)
    14. /
    15. DISPLAY ERRORS;
    16. CREATE OR REPLACE PROCEDURE vtest_insert_sp
    17. (
    18. p_vid IN vtest_insert.vid%TYPE,
    19. p_vnames IN vnames_tab_ty
    20. )
    21. DEFINE AUTHID
    22. IS
    23. BEGIN
    24. DELETE FROM vtest_insert WHERE the vid = p_vid;
    25. FORALL idx IN p_vnames. FIRST... p_vnames. LAST
    26. INSERT INTO vtest_insert (vid, vname) VALUES (p_vid, p_vnames (idx));
    27. END vtest_insert_sp;
    28. /
    29. DISPLAY ERRORS;
    30. >
    31. DECLARE
    32. Vnam vnames_tab_ty;
    33. vid vtest_insert.vid%TYPE.
    34. BEGIN
    35. BK.vid: = 1;
    36. BK.vnames: is vnames_tab_ty ('vn-01', 'vn-02', 'vn-03');.
    37. vtest_insert_sp (p_vid-online bk.vid, p_vnames-online bk.vnames).
    38. COMMIT;
    39. BK.vid: = 2;
    40. BK.vnames: is vnames_tab_ty ('vn-04', 'vn-05', 'vn-06', 'vn-07');.
    41. vtest_insert_sp (p_vid-online bk.vid, p_vnames-online bk.vnames).
    42. COMMIT;
    43. END;
    44. /
    45. SELECT * FROM vtest_insert;

    Which produces the following output

    Table created.

    5 rows created.

    VNAME VID

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

    1-aaaa

    1 bb

    1 cccccc

    2 ddd

    2 EA

    Type of creation.

    No errors.

    Created procedure.

    No errors.

    PL/SQL procedure successfully completed.

    VNAME VID

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

    1 VL-01

    1 VL-02

    1 VL-03

    2 vn-04

    2 vn-05

    2 vn-06

    2 vn-07

    7 selected lines.

    SQL >

    Kind regards

    Dariyoosh

  • LRM-00112: multiple values not allowed for the parameter "control".

    When I'm passing the following in my cmd, I get the error message:
    sqlldr scott/tiger control="C:\Documents and Settings\Sandy\My Documents\address.ctl" log="C:\Documents and Settings\Sandy\My Documents\address.log"
    
    LRM-00112: multiple values not allowed for parameter 'control'
    
    SQL*Loader: Release 10.1.0.2.0 - Production on Tue Mar 22 00:17:18 2011
    
    Copyright (c) 1982, 2004, Oracle.  All rights reserved.
    
    SQL*Loader-100: Syntax error on command-line
    can someone explain to me what is the cause of the error and pls suggest me the correct syntax

    Thanks in advance

    Replace the double quotes ("") by single quotes ('). If this does not work also, try a location without spaces in the directory name.

    Werner

  • How to pass multiple values to a data model parameter

    I have a data model, where I put a setting like this.

    Select col1, col2, col3 from table1 where col1 =: param1

    This works very well for a single value that I pass the param1 parameter.

    How can I get this to work when I want to send multiple values for param1. I already checked the box "Multiple values" and tried to change the sql for this code.

    Select col1, col2, col3 from table1 where col1 in: param1

    Looks like I'm missing something here.



    Thanks in advance!
    Kris

    you need to write it as:

    Select col1, col2, col3 from table1 where col1 in (: param1)

    It works for me.

    Klaus

  • multi value parameter

    Hello

    I have a little problem. I want to spend a muliti value parameter in an Oracle application.
    Actually, I can pass a parameter, but if I chose two value I got an error like: ORA-00933: not correctly completed SQL command
    And if no value is selected, I want to show all values but get the same problem.

    so here's my request:

    SELECT distinct VTMM_PERSON. LASTNAME,
    VTMM_PERSON. FRSTNAME,
    VTMM_STAFF. RELPARENT,
    VTMM_PERSON. REVNAME,
    VTMM_STAFF. ASGNROLE

    TO THINK. VTMM_STAFF,
    THINK. VTMM_PERSON

    WHERE VTMM_PERSON. REVNAME = VTMM_STAFF. RELCHILD
    and VTMM_STAFF. RELPARENT =: RELPARENT--> I have a LOV and a parameter attached to it.
    and VTMM_STAFF. ASGNROLE =: ASGNROLE--> I have a LOV and a parameter attached to it.

    So, I want to choose two values by parameters or if nothing is selected I want to display all values.

    Hope someone can help me.
    Kind regards

    Arnaud

    Hello

    I guess it is a continuation of the question about BI Publisher? So then if you use this SQL:

    SELECT distinct VTMM_PERSON. LASTNAME,
    VTMM_PERSON. FRSTNAME,
    VTMM_STAFF. RELPARENT,
    VTMM_PERSON. REVNAME,
    VTMM_STAFF. ASGNROLE
    TO THINK. VTMM_STAFF,
    THINK. VTMM_PERSON
    WHERE VTMM_PERSON. REVNAME = VTMM_STAFF. RELCHILD
    and VTMM_STAFF. RELPARENT IN (: RELPARENT)
    and VTMM_STAFF. ASGNROLE IN (: ASGNROLE)

    Notice the change in the where statement. You can now change the settings that you created in BI Publisher in "All the values passed" instead of "Value NULL passed" where select all is selected. You can also change the setting of multiple selection if you want people to be able to make multiple choices from the LOV.

    This should get what you want.

    Kind regards

    Matt

  • How to use Ajax get multiple values in an array?

    Hi All-

    I am using AJAX to get multiple values in a table using example of Denes Kubicek in the following link-

    http://apex.oracle.com/pls/otn/f?p=31517:239:9172467565606:NO:

    Basically, I want to use the drop-down list to fill the rest of the values in the form.

    I created the example (Ajax get several values, 54522 application) on the Oracle site.

    http://apex.oracle.com/pls/apex/f?p=4550:1:0:

    Workspace: iConnect

    Login: demo

    password: demo

    I was able to reproduce his example on page 1 (homepage).

    However, I want to use system generate a table to complete this example and was not able to complete the data correctly.

    Page 2 (method 2) is that I'm struggling to fill the column values. When I checked the item application values in the Session, and values seems to be filled properly.

    That's what I did on this page:

    1 create an Application process on-demand - Set_Multi_Items_Tabular2:

    DECLARE
      v_subject my_book_store.subject%TYPE;
      v_price my_book_store.price%TYPE;
      v_author my_book_store.author%TYPE;
      v_qty NUMBER;
    
      CURSOR cur_c
      IS
      SELECT subject, price, author, 1 qty
      FROM my_book_store
      WHERE book_id = :temporary_application_item2;
    BEGIN
      FOR c IN cur_c
      LOOP
      v_subject := c.subject;
      v_price := c.price;
      v_author := c.author;
      v_qty := c.qty;
      END LOOP;
    
      OWA_UTIL.mime_header ('text/xml', FALSE);
      HTP.p ('Cache-Control: no-cache');
      HTP.p ('Pragma: no-cache');
      OWA_UTIL.http_header_close;
      HTP.prn ('<body>');
      HTP.prn ('<desc>this xml genericly sets multiple items</desc>');
      HTP.prn ('<item id="f04_' || :t_rownum || '">' || v_subject || '</item>');
      HTP.prn ('<item id="f05_' || :t_rownum || '">' || v_price || '</item>');
      HTP.prn ('<item id="f06_' || :t_rownum || '">' || v_author || '</item>');
      HTP.prn ('<item id="f07_' || :t_rownum || '">' || v_qty || '</item>');
      HTP.prn ('</body>');
    END;
    
    
    
    
    
    

    2. create two objects application - TEMPORARY_APPLICATION_ITEM2, T_ROWNUM2

    3. put the following text in the Page header:

    <script language="JavaScript" type="text/javascript">
    function f_set_multi_items_tabular2(pValue, pRow){
        var get = new htmldb_Get(null,html_GetElement('pFlowId').value,
    'APPLICATION_PROCESS=Set_Multi_Items_Tabular2',0);
    if(pValue){
    get.add('TEMPORARY_APPLICATION_ITEM2',pValue)
    get.add('T_ROWNUM2',pRow)
    }else{
    get.add('TEMPORARY_APPLICATION_ITEM2','null')
    }
        gReturn = get.get('XML');
        if(gReturn){
            var l_Count = gReturn.getElementsByTagName("item").length;
            for(var i = 0;i<l_Count;i++){
                var l_Opt_Xml = gReturn.getElementsByTagName("item")[i];
                var l_ID = l_Opt_Xml.getAttribute('id');
                var l_El = html_GetElement(l_ID);    
                if(l_Opt_Xml.firstChild){
                    var l_Value = l_Opt_Xml.firstChild.nodeValue;
                }else{
                    var l_Value = '';
                }
                if(l_El){
                    if(l_El.tagName == 'INPUT'){
                        l_El.value = l_Value;
                    }else if(l_El.tagName == 'SPAN' && l_El.className == 'grabber'){
                        l_El.parentNode.innerHTML = l_Value;
                        l_El.parentNode.id = l_ID;
                    }else{
                        l_El.innerHTML = l_Value;
                    }
                }
            }
        }
        get = null;
    }
    </script>
    
    
    Add the follwing to the end of the above JavaScript:
    
    <script language="JavaScript" type="text/javascript">
    function setLOV(filter, list2)
    {
     var s = filter.id;
     var item = s.substring(3,8);
     var field2 = list2 + item;
     
     f_set_multi_items_tabular2(filter, field2);
    }
    
    
    
    
     
    
    
    

    4 query in the form:

    select
    "BOOK_ID",
    "BOOK",
    "SUBJECT",
    "PRICE",
    "AUTHOR",
    "QTY",
    "BOOK_ID" BOOK_ID_DISPLAY
    from "#OWNER#"."MY_BOOK_STORE"
    
    
    
    
    
    

    5. in the column of Book_ID_DISPLAY attribute:

    Add the following code to the attributes of the element: onchange = "javascript:f_set_multi_items_tabular2(this.value,'#ROWNUM#'); »

    Changed-> onchange = "javascript:setLOV(this,'f03'); »

    Now, T_ROWNUM2 returns the value as f03_0001. But TEMPORARY_APPLICATION_ITEM2 returns in the form [object HTMLSelectElement]...

    Please help me to see how I can fill the data in the tabular presentation format. Thank you in advance!

    Ling

    Updating code in red...

    Ling

    LC says:

    Application Item Value Item Name
    54522 3 TEMPORARY_APPLICATION_ITEM2
    54522 f03_0003 T_ROWNUM2

    No T_ROWNUM2 should be 0003.

    I made a copy of your page to make corrections.

    There are several problems.

    First you where submiting T_ROWNUM2 whereas you would use: t_rownum in the pl/sql code.

    I changed the name of the element in the f_set_multi_items_tabular2.

    Secondly you where now affecting the rownumber f03_0001 for the first line.

    Resulting XML returned as follows.

    this xml genericly sets multiple items
    CSS Mastery
    22
    Andy Budd
    1
    
    

    I changed the following text in the show_lov.

    var point = s.substring (4.8);

    var Field2 = item;

    I also had a compilation of pl/sql code error, there was a); missing the end of the last item. Fixed that too.

    But why do you think lpad won't work for lines 10 and more.

    LPAD ('10', 4, '0') will give "0010"

    LPAD ('100 ', 4,'0 ') will give "0100"

    LPAD ('1000 ', 4,'0 ') will give '1000'

    So unless you have more than 9999 lines you would have no problem.

    Nicolette

  • passing multiple values of variable presentation to go the url in dashboard

    Hi all

    I use go url in dashboard in the area of text using html file mark up. We have a guest area which saves the values in the variable of presentation P_REGION. The link to the dashboard works well when we choose to value as a single region. She passes the parameter. However, if we choose multiple values, it fails. Do we need to modify the code below in support of more than the presentation variable value to pass to the report.


    <a href="http://nqrc.cci.edu:7001/analytics/saw.dll?PortalGo&path=%2Fusers%2Faron%2FActionLink%2Fname&Action=Navigate&P0=1&P1=eq&P2=%22Employee%22.%22Region%22&P3=@{variables.P_REGION}">Drill Report</a>
    Thank you

    Sushil

    Before you go to the link, I would say to understand how the variable takes values.
    Try to use the link as ay of the column expression in the criteria to see the full url with multiple values.

    http://nqrc.cci.edu:7001/analytics/saw.dll?PortalGo&path=%2Fusers%2Faron%2FActionLink%2Fname&Action=Navigate&P0=1&P1=eq&P2=%22Employee%22.%22Region%22&P3=@{variables. P_REGION}

    If my assumption is not wrong valiables holds as "one, two."

    This will give you some ideas to work on.
    If need more help to share the url with multiple values.

    BTW: I don't think that it works with multiple values, give a try, as said.

    So much sense mark :)

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

  • Return multiple values from a table

    Hi there I'm working on a bit of sql that returns values when they exist in a table.
    The code I have returns the correct value when there is an entry in the tbl_studentmodules table, as soon as there is more than one entry in this table it does display no line at all: (.)

    Can someone tell how to return multiple values?

                 select modulename from tbl_modulefeedback
    where 1 = (select count(*) from tbl_studentmodules
           where upper(:APP_USER) = upper(student_id))
    and 1 = (select count(*) from tbl_modulefeedback, tbl_studentmodules
          where tbl_modulefeedback.modulecode = tbl_studentmodules.modulecode)
    Thanks in advance!

    Ashleigh

    Try this:

    select modulename
    from tbl_modulefeedback
    where 1 <= (select count(*) from tbl_studentmodules
           where upper(:APP_USER) = upper(student_id))
    and 1 <= (select count(*) from tbl_modulefeedback, tbl_studentmodules
          where tbl_modulefeedback.modulecode = tbl_studentmodules.modulecode)
    

    When you ask questions, please enter CREATE TABLE and INSERT some commands to make it easier to help you.

  • Another REGEXP question: how to extract multiple values from a string

    Hi, how can I retrieve multiple values to a string with RegExp with Oracle SQL constructs?

    Have looked at the various examples, I cannot understand this.
    the following Sql code
    select
       regexp_substr(sessie."rollen", 'CN=A_role') "A_role"
       from ( 
    select '
    CN=A_role,OU=a_org_unit,OU=another_org_unit,DC=bz,DC=ad,DC=min,DC=local
    CN=Another_role,OU=some_org_unit,DC=bz,DC=ad,DC=min,DC=local
    CN=Users,OU=Dep,DC=bz,DC=ad,DC=min,DC=local
    '   "rollen" from dual
    ) sessie;
    Returns CN = A_role.
    I want him back all of the CN = concatenated values with a semicolon and stripped of the CN = bit.
    So: A_role; Another_role; Users .

    Any help would be much appreciated. Here I use database 11g 11.2.0.2.0.

    Does anyone have an idea how to do this in SQL?

    best regards Mike

    Hello
    If using Oracle 11 g

    with tst
      as (select   'CN=A_role,OU=a_org_unit,OU=another_org_unit,DC=bz,DC=ad,DC=min,DC=local,'
                 ||'CN=Another_role,OU=some_org_unit,DC=bz,DC=ad,DC=min,DC=local,'
                 ||'CN=Users,OU=Dep,DC=bz,DC=ad,DC=min,DC=local' as rollen
            from dual
          )
    select listagg(sub, ',') within group (order by rn) as res
      from (select regexp_substr(rollen, '(CN=)([[:alnum:]_]+)',1,rownum,'i',2) sub, rownum rn
              from tst
           connect by level <=length(rollen)
           )
     where sub is not null       
    
  • Cannot get 'IN' text field with multiple values.

    I have a text field (P11_SERIAL_NUMBERS) someone would use to enter multiple values (i.e. of the serial numbers). I tested various methods but can't seem to get anything working. I used values such as ' 12929', '19191' or ('11919', ' 19192 ', ' 1111') or 12121,121333.»

    I have to analyze this area after the entrance is and update P11_SERIAL_NUMBER to something like ("121212 ', 121211', '292929'). The report is a SQL query returning the body of a PL/SQL function. I build the query in an anonymous block to something like the following:

    SELECT apex_item.checkbox (1, instance_number) Ins,.
    apex_item. Text(2,i.instance_number) instance_number.
    apex_item. Text(3,i.item_number) item_number.
    description of the apex_item. Text(4,i.Description),
    Serial_number apex_item. Text(5,i.serial_number),
    i.party_name,
    i.status_name
    Cycsi_item_details_v I have
    WHERE i.item_number IN (SELECT v.item_number FROM cycsi_installed_base_v WHERE v.serial_number = i.serial_number v)
    AND i.item_number AS NVL ('%' |') XLA' | ' %','%')
    AND NOT EXISTS (SELECT d.item_serial_number FROM cy_fco_d, d WHERE d.fco_id = 2803 AND d.item_serial_number = i.serial_number) AND i.serial_number IN ('61763 ', ' 61621');

    However, when I enter several values that nothing ever went back to the SUMMIT even though the SQL query returns more rows. I run the application in debug mode and it seems to show the values correctly.

    0.11: show report
    0.12: determine the column headings
    0.12: analyze the query such as: TRAFFIC
    0.15: binding: ": P11_MODEL_NUMBER"= "P11_MODEL_NUMBER" value = "XLA"»
    0.16: binding: ": P5_FCO_ID"= "P5_FCO_ID" value = "2803"»
    0.17: binding: ": P11_SERIAL_NUMBERS"= "P11_SERIAL_NUMBERS" value = '(' 61621', ' 61763')""
    0.19: print the column headings
    0.19: loop lines: 15 rows
    No data found

    If I add only a serial number at a time as the APEX application returns the line correctly.


    Does anyone have an idea what I'm doing wrong or what best way to solve this problem?
    Thank you
    John

    Published by: Jennifer on July 13, 2010 15:23

    Hi John,.

    I just tried a report region based on PL/SQL query encoded using your method to refer to element names in the query string of back:

    declare
       q varchar2(100) := 'select ename, job from emp';
    begin
       if :P2_ENAMES is not null then
            q := q || ' where ename in :P2_ENAMES';
       end if;
    
       wwv_flow.debug('*** Query: ' || q);
    
       return q;
    end;
    

    As I suspected, he did not work for me P2_ENAMES was ('KING') or ('KING', 'SMITH'). I think it's because of the reason for which I gave in my previous post - ApEx passes off the coast of the dynamic execution of SQL string, it does not automatically replace the mention: P2_ENAMES with the value of the element. I don't know how it can work for you.

    If I change the code I proposed:

    declare
       q varchar2(100) := 'select ename, job from emp';
    begin
       if :P2_ENAMES is not null then
            q := q || ' where ename in ' || :P2_ENAMES;
       end if;
    
       wwv_flow.debug('*** Query: ' || q);
    
       return q;
    end;
    

    It works very well if one or several names are specified.

    I took a blow to modify your code for the construction of the query string - does not immediately guarantee, it'll work because I can't test (might be missing a parenthesis or quotation) it but you should get the idea:

    -- start with initial valid query that ApEx can parse to determine column names
    q := 'SELECT apex_item.checkbox(1, instance_number) ins, apex_item.text(2, i.instance_number) instance_number,
                 apex_item.text(3, i.item_number) item_number, apex_item.text(4, i.description) description,
                 apex_item.text(5, i.serial_number) serial_number, i.party_name, i.status_name
            FROM cycsi_item_details_v i
           WHERE i.item_number IN (SELECT v.item_number
                                     FROM cycsi_installed_base_v v
                                    WHERE v.serial_number = i.serial_number)';
    
    -- add model number condition if specified
    if :P11_MODEL_NUMBER is not null then
       q := q || ' AND i.item_number LIKE ''%' || :P11_MODEL_NUMBER || '''%''';
    end if;
    
    -- add serial numbers condition if specified
    if :P11_SERIAL_NUMBERS is not null then
       q := q || ' AND i.serial_number IN (' || :P11_SERIAL_NUMBERS || ')';
    end if;
    
    -- add FCO id condition if specified
    if :P5_FCO_ID is not null then
       q := q || ' AND NOT EXISTS (SELECT d.item_serial_number
                                     FROM cy_fco_d d
                                    WHERE d.fco_id = ' || :P5_FCO_ID || '
                                      AND d.item_serial_number = i.serial_number)';
    

    I know that has focused on getting this code works, but I would be remiss in my duties if I didn't at least mention the risk of SQL injection. You may already know this, but unless you do a good job to validate the values of the element used in the query, you could open yourself up to a SQL injection attack. For example, imagine what that would be returned if a hacker sharp entered "12345) GOLD (1 = 1" in the field of P11_SERIAL_NUMBERS - you would get all that may or may not be a security problem.

    Hope this helps,
    John

  • How to url using NOT IN (NIN) IR filter for multiple values?

    Apex 5.0.1 (but should work for Apex 4.2)

    I want to set a url with an IR filter using the filter NOT IN. For example, to get a filter that says: status not in (3,4)

    To do this, we can use the url IRNIN_STATUS parameter.

    This method works. Problem is how can I set multiple values in the url?

    IRNIN_STATUS:3, 4 will give a filter 'status not in (3) '

    4 is interpreted as the following for the next parameter value, even if there is no additional parameters.

    Find / remember the solution:

    We can add the backslashes to values to distinguish them from others.

    IRNIN_STATUS:\3, 4

Maybe you are looking for

  • ZTE phone open does not start after the 1.1 update

    I got the download of the update 1.1 ZTE official. I followed the instructions, but when the phone rebooted it goes to a white screen after reading the firefox boot animation. I left it sitting there for 10 minutes and he wouldn't answer. Eventually

  • Download Manager, any other programms?

    I have an unstable connection... when downloading and driveway connection makes downloading and I have to start from the beginning... is there any other Download Manager works with firefox who already watch downloaded bits and bytes?

  • Printing from W7 HP laptop attached to a Win XP Pro Office; driver needed?

    Hello: Have a home network of XP machines that allows to print on a HP 3030 printer that is usb attached to a wireless Win XP Pro SP3 desktop.  Find everything HP/fine print.  Added a portable W7 Home Prem 64 b, changed the name of default WORKING gr

  • Put photo on ETSY

    When I go to download pic on ETSY, I can not find the folder that contains the picture I want.  I have just listed on Craigs list and he worked there.  ETSY has worked before. When I go into start, photo gallery, I see what I want to put on ETSY, but

  • win2k8R2 install problem on C200M2

    I have ucs-c200m2 with soft raid1 on two hard drives of 500G. I'm trying to install the server windows 2008 R2, but installation never finished. in the last step "Finish the Installation" reboot the server and after startup I get the following: all s