How to ignore delimiter string

Hi, I am currently using a Scanner in conjunction with a delimiter to read in Information from a text file.
               String t = inFile.next();
               int numbOfCand = Integer.parseInt(t);
               for(int i = 0; i < numbOfCand; i++)
                    inFile.useDelimiter(";");
                    String candName = inFile.next();
                    inFile.useDelimiter("\r\n");
                    String candAffil = inFile.next();
                    Candidate CurrentCand = new Candidate(candName, candAffil);
                    newBallot.addCandidate(CurrentCand);
               return newBallot;
     The problem is, after I have stored these strings into an ArrayList and spit them back out on the console. The ";" from the original text file also gets printed back out on the console, along with an extra linebreak. What can I modify to prevent this from being referenced into the String variables?
Thanks.

I've just seen what happens...
Scanner's next() returns the next token using the current delimiter. When you change the delimiter the "pointer" (the current reading position) of the scanner will be just before the old delimiter. Hence every time you call next() you are getting a string that starts with the old delimter. So the names all have "\r\n" in front of them and the affiliations all have ";" in front of them.
One way would be to not keep changing the delimiters. Use a single delimiter - a pattern that recognises either a ; or the "\r\n" sequence.
import java.util.Scanner;
public class Vote {
    public static void main(String args[])
            // to test
        String data = "2\r\nFred;Red\r\nBruce;Blue\r\n";
        Scanner inFile = new Scanner(data);
            // use this delimiter pattern instead of the ones below
        //inFile.useDelimiter("(\r\n)|;");
        String t = inFile.next();
        int numbOfCand = Integer.parseInt(t);
        for(int i = 0; i < numbOfCand; i++)
            inFile.useDelimiter(";");
            String candName = inFile.next();
            System.out.println("candName read as: " + candName);
            inFile.useDelimiter("\r\n");
            String candAffil = inFile.next();
            System.out.println("candAffil read as: " + candAffil);
            //Candidate CurrentCand = new Candidate(candName, candAffil);
            //newBallot.addCandidate(CurrentCand);
        //return newBallot;
}Of course this assumes that ; won't ever occur as part of an affiliation, and "\r\n" as part of a name.

Similar Messages

  • How to Identify the count , If multiple parameters are passed using Pipe Delimited string

    Hi,
    We are passing Pipe delimited string to the parameter and I want to know how many values we are passing to the parameter.
    Here is the example
    Parameter.Grant: 24|34|54|67
    I am using below expression, but it is not giving the right values. Please let me know if  I am missing anything or is it possible.
    =iif(parameters!Grant.Count>1,"Multiple value selected",parameters!Grant.Value)

    Hi NaveenCR,
    According to your description, you used pipe delimited multi-value parameter in the report, you want to know how many values passed to the parameter. If that is the case, please refer to the following steps:
    In Design view, click Text Box in the Toolbox.
    On the design surface, click and then drag a box to the desired size of the text box.
    Right-click inside of the text box, then click Expression.
    In Expression text box, type the expression like below:
    =iif(split(Parameters! Grant.Value,"|").Length>1," Multiple value selected",Parameters!Grant.Value)
    The following screenshots are for your reference:
    If you have any more questions, please feel free to ask.
    Thanks,
    Wendy Fu
    If you have any feedback on our support, please click
    here.
    Wendy Fu
    TechNet Community Support

  • How to compare two strings whether both are equal while ignoring the difference in special characters (example: & vs & and many others)?

    I attempted to compare two strings whether they are equal or not. They should return true if both are equal.
    One string is based on Taxonomy's Term (i.e. Term.Name) whereas other string is based on String object.
    The problem is that both strings which seem equal return false instead of true. Both string values have different special characters though their special characters are & and &
    Snapshot of different design & same symbols:
    Is it due to different culture or language?
    How to compare two strings whether both are equal while ignoring the difference in special characters (& vs &)?

    Hi Jerioon,
    If you have a list of possible ambiguous characters the job is going to be easy and if (& vs &) are the only charracters in concern awesome.
    You can use the below solution.
    Before comparing pass the variables through a replace function to standarize the char set.
    $Var = Replace($Var,"&","&")
    This is going to make sure you don't end up with ambiguous characters failing the comparison and all the char are "&" in this case.
    Similar technique is used to ignore Character Cases 'a' vs. 'A'
    Regards,
    Satyajit
    Please “Vote As Helpful”
    if you find my contribution useful or “Mark As Answer” if it does answer your question. That will encourage me - and others - to take time out to help you.

  • How to split a delimited string into an array...

    I have a delimited string coming in to a stored procedure (SP) for vb.net that needs to be parsed/converted into multi-dimensional arrays. The reason I am using delimited string because I do not know how to pass arrays to oracle SP from vb.net using ODP or MPO (Microsoft's Provider for Oracle).
    My delimited string looks something like this: "level1_1|level2_1:level3_1;level3_2|level2_2:level3_1;level3_2~Level1_2|level2_2:level3_1"
    So, its going to be 3d array. I would greatly appreciate if anyone could help me solving this puzzle. Any examples would be a great help.
    Thanks for everything in advance,
    Vincent

    Hi Andrew,
    I appreciate your response. Currently I use "Microsoft provider for Oracle" to connect to Oracle Database because when I started with my application there wasn't ODP (Oracle Data Provider for .Net) available. So, I used Microsoft provider and still using it.
    I know how to use arrays in .Net but the problem is I can not find the Oracle Type to pass the array to Oralce Stored Procedure using this provider.
    It would be very helpful if someone shows me the syntax for both to receive from oracle and transport to Oracle. I haven't tried using ODP yet. May be now its the time to see how it works.
    And of course, your link was very helpful but I am already doing that (which is very slow for multi-dimentional array). So, I thought there might be a built in function in oracle which does that. Because most of the programming languages does have built in function for this conversion. for example: Split() in vb, java, javascript etc.
    Anyway, if anyone finds any clues as to how to pass milti-dimentional arrays from .Net (microsoft) to oracle stored procedure please, please let me know how to do that.
    -Vincent

  • How to Splilit The String Into Single Column using Comma As Delimiter ?

    How to Splilit The String Into Single Column using Comma As Delimiter ?
    using Function

    refer my thread ,code is also available see if that helps you
    error while executing the sp ORA-21779: duration not active

  • How to use create-nodeset-from-delimited-string()

    Hi All,
    I am getting the input data as following
    name rollno sub
    Anu 1 Maths|science|social
    and the output should be as follows:
    name rollno sub
    Anu 1 Maths
    Anu 1 Science
    Anu 1 Social
    I need to implememt this by using oraext:create-nodeset-from-delimited-string() in XSLT Pls help me out in resolving this issue
    Regards,
    Anasuya

    can u elaborate the query with ur input xml and output xml for clear understanding instead of
    name rollno sub
    Anu 1 Maths|science|social
    and the output should be as follows:
    name rollno sub
    Anu 1 Maths
    Anu 1 Science
    Anu 1 Social
    check the following links it might help u
    http://www.soabyte.com/2011/01/delimited-string-to-xml-nodeset.html
    Edited by: olety on Nov 2, 2011 2:29 AM

  • How to convert a delimited string to XML?

    Hi there,
    Please help me to convert a pipe delimited string into XML, e.g.
    string -------SubName:abc|SuvValue:123|
    required XML:
    <ROWS>
    <ROW>
    <SubName>abc</SubName>
    <SubValue>123</SubValue>
    </ROW>
    </ROWS>
    or
    string -------abc|123|
    required XML:
    <ROWS>
    <ROW>
    <SubName>abc</SubName>
    <SubValue>123</SubValue>
    </ROW>
    </ROWS>
    -----i am trying to first parse the string into a table type and then using the DBMS_XMLGen.getXML function but unable to get values from table type...
    any prompt response is highly appriciated...
    Regards, Hassan

    Hi Hassan,
    If your version supports it (ie 10gR2 and upwards), you can use XQuery to directly parse the string and generate the XML :
    SQL> SELECT XMLQuery(
      2   '<ROWS>
      3    <ROW> {
      4     for $i in ora:tokenize($str,"\|")
      5     return
      6      if ($i) then element {substring-before($i,":")} {substring-after($i,":")}
      7      else ()
      8   } </ROW>
      9   </ROWS>'
    10   passing sys_xmlgen('SubName:abc|SubValue:123|') as "str"
    11   returning content
    12  ).getClobVal()
    13  FROM dual;
    XMLQUERY('<ROWS><ROW>{FOR$IINO
    <ROWS><ROW><SubName>abc</SubName><SubValue>123</SubValue></ROW></ROWS>
    Each element is built based on its name from the input string.

  • How to parse a delimited string and insert into different columns?

    Hi Experts,
    I need to parse a delimited string ':level1_value:level2_value:level3_value:...' to 'level1_value', 'level2_value', etc., and insert them into different columns of one table as one row:
    Table_Level (Level1, Level2, Level3, ...)
    I know I can use substr and instr to get level value one by one and insert into Table, but I'm wondering if there's better ways to do it?
    Thanks!

    user9954260 wrote:
    However, there is one tiny problem - the delimiter from the source system is a '|' When I replace your test query with | as delimiter instead of the : it fails. Interestingly, if I use ; it works. See below:
    with t as (
    select 'str1|str2|str3||str5|str6' x from dual union all
    select '|str2|str3|str4|str5|str6' from dual union all
    select 'str1|str2|str3|str4|str5|' from dual union all
    select 'str1|str2|||str5|str6' from dual)
    select x,
    regexp_replace(x,'^([^|]*).*$','\1') y1,
    regexp_replace(x,'^[^|]*|([^|]*).*$','\1') y2,
    regexp_replace(x,'^([^|]*|){2}([^|]*).*$','\2') y3,
    regexp_replace(x,'^([^|]*|){3}([^|]*).*$','\2') y4,
    regexp_replace(x,'^([^|]*|){4}([^|]*).*$','\2') y5,
    regexp_replace(x,'^([^|]*|){5}([^|]*).*$','\2') y6
    from t;
    The "bar" or "pipe" symbol is a special character, also called a metacharacter.
    If you want to use it as a literal in a regular expression, you will need to escape it with a backslash character (\).
    Here's the solution -
    test@ORA11G>
    test@ORA11G> --
    test@ORA11G> with t as (
      2    select 'str1|str2|str3||str5|str6' x from dual union all
      3    select '|str2|str3|str4|str5|str6' from dual union all
      4    select 'str1|str2|str3|str4|str5|' from dual union all
      5    select 'str1|str2|||str5|str6' from dual)
      6  --
      7  select x,
      8         regexp_replace(x,'^([^|]*).*$','\1') y1,
      9         regexp_replace(x,'^[^|]*\|([^|]*).*$','\1') y2,
    10         regexp_replace(x,'^([^|]*\|){2}([^|]*).*$','\2') y3,
    11         regexp_replace(x,'^([^|]*\|){3}([^|]*).*$','\2') y4,
    12         regexp_replace(x,'^([^|]*\|){4}([^|]*).*$','\2') y5,
    13         regexp_replace(x,'^([^|]*\|){5}([^|]*).*$','\2') y6
    14  from t;
    X                         Y1      Y2      Y3      Y4      Y5      Y6
    str1|str2|str3||str5|str6 str1    str2    str3            str5    str6
    |str2|str3|str4|str5|str6         str2    str3    str4    str5    str6
    str1|str2|str3|str4|str5| str1    str2    str3    str4    str5
    str1|str2|||str5|str6     str1    str2                    str5    str6
    4 rows selected.
    test@ORA11G>
    test@ORA11G>isotope
    PS - it works for semi-colon character ";" because it is not a metacharacter. So its literal value is considered by the regex engine for matching.
    Edited by: isotope on Feb 26, 2010 11:09 AM

  • How to pass a string varaible to an internal table field

    Hi Experts,
    I am reading notes/text entries by calling read_text and then passing them in a variable. I want to display the notes. But even after declaring the variable as  LINE2048, it is displaying only 255characters as output length.
    My code:
    TYPES: BEGIN OF TYP_FINAL,
             PARTNER_NO      TYPE BU_PARTNER,         "Partner No.
            OBJECT_ID       TYPE CRMT_OBJECT_ID_DB,  "Object ID
            PROCESS_TYPE    TYPE CRMT_PROCESS_TYPE,  "Activity Type
           ACTUAL_NOTE     TYPE LINE2048,           "Actual Notes
           END OF TYP_FINAL.
    data : T_FINAL           TYPE STANDARD TABLE OF TYP_FINAL,
              WA_FINAL          TYPE TYP_FINAL.
    data:  v_actualnote     TYPE LINE2048.
              CALL FUNCTION 'READ_TEXT'
                EXPORTING
                 CLIENT                        = SY-MANDT
                  ID                            = C_0002
                  LANGUAGE                      = sy-langu
                  NAME                          = l_name1
                  OBJECT                        = C_BUT000
                TABLES
                  LINES                         = t_line
               EXCEPTIONS
                 ID                            = 1
                 LANGUAGE                      = 2
              IF SY-SUBRC = 0.
               clear: v_accountnote.
               LOOP AT T_LINE INTO WA_LINE.
                 CONCATENATE v_accountnote wa_line INTO v_accountnote SEPARATED BY space.
                 clear: wa_line.
               ENDLOOP.
              wa_final-account_note = v_accountnote.
              clear: v_accountnote.
             ENDIF.
    So, if I make the v_actualnote as string and pass it to a string variable, that should work.
    But the system is not allowing me to declare a string varaible inside the internal table.
    Please let me know how to display more than 255 characters in v_accountnote  .
    Regards,
    Sangeeta.

    you are passng that as a string = '5,6' does not exist
    try this : http://www.mssqltips.com/sqlservertip/1771/splitting-delimited-strings-using-xml-in-sql-server/
    declare @table table(sno int)
    insert into @table values(5),(6)
    DECLARE @xml as xml,@txtSchedule as varchar(100),@delimiter as varchar(10)
    SET @txtSchedule='5,6'
    SET @xml = cast(('<X>'+replace(@txtSchedule,',','</X><X>')+'</X>') as xml)
    select * from @table WHERE sno IN ( select N.value('.', 'varchar(10)') as value FROM @xml.nodes('X') as T(N))
    Hope it Helps!!

  • Converting Delimited string to XML message

    Hi,
    We are trying to convert pipe delimited string into a xml schema using a XSD and BPEL funtion. Consider a scenario in which message has 5 fields with last as 2 optional fields. So the incoming string message can be like "1|2|3" or "1|2|3|4|5". In this case how the XSD should look like, since for each field we have to give "terminatedby" option in the XSD. So the issue is coming for element 3 where the delimiter can be "|" or "eol" (end of line). How to specify that ? Is there any option to use like "optionally terminated by?"
    Any help will be appreciated.
    Thanks,
    Ramesh
    Edited by: rameshchandra85 on 2 Aug, 2010 10:00 AM

    Hi Ramesh,
    You can use below XSD for input file of kind
    1|2|3
    1|2|3|4|5
    1|2|3|4
    1|2|3|4|5|6
    <?xml version="1.0" encoding="UTF-8" ?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                xmlns:nxsd="http://xmlns.oracle.com/pcbpel/nxsd"
                targetNamespace="http://TargetNamespace.com/InboundService"
                xmlns:tns="http://TargetNamespace.com/InboundService"
                elementFormDefault="qualified"
                attributeFormDefault="unqualified" nxsd:encoding="ASCII" nxsd:stream="chars" nxsd:version="NXSD">
      <xsd:element name="Root-Element">
        <xsd:complexType>
          <xsd:choice minOccurs="1" maxOccurs="unbounded" nxsd:choiceCondition="terminated" nxsd:terminatedBy="|">
            <xsd:element name="RECORD1" nxsd:conditionValue="1">
              <xsd:complexType>
                <xsd:sequence>
                  <xsd:element name="C2" type="xsd:int" nxsd:style="terminated" nxsd:terminatedBy="|" nxsd:quotedBy="&quot;">
                  </xsd:element>
                  <xsd:element name="C3" type="xsd:int" nxsd:style="terminated" nxsd:terminatedBy="${eol}" nxsd:quotedBy="&quot;">
                  </xsd:element>
                </xsd:sequence>
              </xsd:complexType>
            </xsd:element>
            <xsd:element name="RECORD2" nxsd:conditionValue="2">
              <xsd:complexType>
                <xsd:sequence>
                  <xsd:element name="C2" type="xsd:int" nxsd:style="terminated" nxsd:terminatedBy="|" nxsd:quotedBy="&quot;">
                  </xsd:element>
                  <xsd:element name="C3" type="xsd:int" nxsd:style="terminated" nxsd:terminatedBy="|" nxsd:quotedBy="&quot;">
                  </xsd:element>
                  <xsd:element name="C4" type="xsd:int" nxsd:style="terminated" nxsd:terminatedBy="|" nxsd:quotedBy="&quot;">
                  </xsd:element>
                  <xsd:element name="C5" type="xsd:int" nxsd:style="terminated" nxsd:terminatedBy="${eol}" nxsd:quotedBy="&quot;">
                  </xsd:element>
                </xsd:sequence>
              </xsd:complexType>
            </xsd:element>
            <xsd:element name="RECORD3" nxsd:conditionValue="3">
              <xsd:complexType>
                <xsd:sequence>
                  <xsd:element name="C2" type="xsd:int" nxsd:style="terminated" nxsd:terminatedBy="|" nxsd:quotedBy="&quot;">
                  </xsd:element>
                  <xsd:element name="C3" type="xsd:int" nxsd:style="terminated" nxsd:terminatedBy="|" nxsd:quotedBy="&quot;">
                  </xsd:element>
                  <xsd:element name="C4" type="xsd:int" nxsd:style="terminated" nxsd:terminatedBy="${eol}" nxsd:quotedBy="&quot;">
                  </xsd:element>
                </xsd:sequence>
              </xsd:complexType>
            </xsd:element>
            <xsd:element name="RECORD4" nxsd:conditionValue="4">
              <xsd:complexType>
                <xsd:sequence>
                  <xsd:element name="C2" type="xsd:int" nxsd:style="terminated" nxsd:terminatedBy="|" nxsd:quotedBy="&quot;">
                  </xsd:element>
                  <xsd:element name="C3" type="xsd:int" nxsd:style="terminated" nxsd:terminatedBy="|" nxsd:quotedBy="&quot;">
                  </xsd:element>
                  <xsd:element name="C4" type="xsd:int" nxsd:style="terminated" nxsd:terminatedBy="|" nxsd:quotedBy="&quot;">
                  </xsd:element>
                  <xsd:element name="C5" type="xsd:int" nxsd:style="terminated" nxsd:terminatedBy="|" nxsd:quotedBy="&quot;">
                  </xsd:element>
                  <xsd:element name="C6" type="xsd:int" nxsd:style="terminated" nxsd:terminatedBy="${eol}" nxsd:quotedBy="&quot;">
                  </xsd:element>
                </xsd:sequence>
              </xsd:complexType>
            </xsd:element>
          </xsd:choice>
        </xsd:complexType>
      </xsd:element>
    </xsd:schema>
    <!--NXSDWIZ:D:\DBIN\ReadFile.txt:-->
    <!--USE-HEADER:false:-->But in your case if you are getting 5 elements instead of 3 elements in some other file....Use the same and maipulate the last element afterwards.
    I think we can not have an element definition for two scenarios.
    Update you if i get any..
    Regards
    PavanKumar.M

  • Comma delimited string relating to subreports

    I previously opened a discussion called comma delimited string for a report header. The response I received then worked well for 'Year' but not for two other areas I am trying to use it for.
    Original Code
    Details:
    whileprintingrecords;
    stringvar Year:= Year+ {@Year} + ", ";
    Report Footer:
    whileprintingrecords;
    stringvar Year;
    Left(Year, len(Year)-2);
    I needed to modify the code to eliminate duplication in Year and this worked fine. See the code below. I also needed this code for two other areas, Author and School. Without the extra line of code with the 'instr' function the code would always show and error for ' Left(author, len(author)-2);'.  It came up with and error saying that the result was less than 0 or not and integer and went into debug mode. I added the instr function line and it worked for most but not all. This is my problem. Either the ' Left(author, len(author)-2);' line or 'If instr(author, {@Author } ) = 0 then' makes data disappear. It will show a comma delimited string for 'Author' on most rows but not from some. The same would be true for' School'. I am not sure what is going on. The code below is what I am currently using in the subreports.
    Details:
    whileprintingrecords;
    stringvar author;
    If instr(author, {@Author}) = 0 then
        author:= author + {@Author } + ", ";
    Report Footer:
    whileprintingrecords;
    stringvar author;
    If instr(author, {@Author } ) = 0 then
        author:= author + {@Author }  + ", ";
    Else
        Left(author, len(author)-2);

    Hi Abhilash,
    The code for the @Author is:
    If ({Command.chrStatus} = "External")then
        {Command.chrSurname} & ", " & {Command.chrFirstname}
    Else
        {Command.chrSurname(1)} & ", " & {Command.chrFirstname(1)}
    The goal of this code was to pull all the authors into one comma delimited string.
    eg Smith, Brian; Jones, Barry; Lee, Henry
    The same desire was with the Schools and the code was the same. I just don't know why this is returning the blanks.
    You mentioned in the last post that this would be better done in an SQL command. Should I open up another discussion because I think this would be the way to go. I just don't know how I can do the same comma delimited code in SQL.
    Thanks

  • Setting FileControl delimiter string programatically

    Hello,
    I'm working with WLI's FileControls. I'd like to configure a FileControl instance at runtime. I can set many of the FileControl properties using the FileControlPropertiesDocument. One thing I'd like to dynamically configure is the delimiter string. This attribute, however, is part of a nested class within FileControl called IOOperation. I don't see how to set the values of the IOOperation attributes programatically. They appear to be set as part of an annotation, and are read-only at runtime. Has anyone tried something like this before?
    Thanks very much,
    Brian.

    Hello,
    I'm working with WLI's FileControls. I'd like to configure a FileControl instance at runtime. I can set many of the FileControl properties using the FileControlPropertiesDocument. One thing I'd like to dynamically configure is the delimiter string. This attribute, however, is part of a nested class within FileControl called IOOperation. I don't see how to set the values of the IOOperation attributes programatically. They appear to be set as part of an annotation, and are read-only at runtime. Has anyone tried something like this before?
    Thanks very much,
    Brian.

  • Any Easy way to get Delimited String

    Hi,
    I have use create-delimited-string function in my BPEL process to create "," delimited string. i.e string1,string2,string3.
    What is best way to parse this string to get individual string.
    I want to parse string1,string2,string3 to get
    string1
    string2
    string3
    like StringTokenizer in java.
    Thanks
    Jigar

    Off the top of my head, you could create a bpel while loop, that loops until a string contains(',') function returns false.
    Then within the while loop do a substring-before() function to obtain each string before the comma.
    The issue above is that you will have to predefine the variables you are populating, so if you do not know how many results there are this may be a problem.
    I'm sure there are a couple of ways of doing this though. If you're not happy with it all and need a quick solution then there is always embedded java.

  • DRM Function to divide comma delimited string to list value

    Hi
    Any one knows how to seperate comma delimited string into list values.
    Thanks

    Are you wanting to dynamically set the list values for a property? If so there are a couple options:
    1. You can update them via the API.
    2. You can write a sql script to update the table Property_List. This requires an application server restart and generally isn't recommended for support reasons but it makes sense in some instances.
    Edited by: Naren Truelove on 16/02/2011 22:08

  • Delimited String To A Single Row Within A Table

    I'll try to make a simple example of what I am trying to accomplish...
    Let's say that I have a table (Blah) which has the following Fields:
    User, DateTime, Q1, Q2.... all the way to Q50.  The Questions are radios with a value of 1,0, or null.
    Since I didn't want to manually make 50 different items for the Radio questions, I am creating them from Javascript within a Region Source; as well as giving them id's and names.  This worked fine.
    When I hit a submit button, I have Javascript create a delimited string for the questions, which I pass to a Shared Item.  (1,0,1,1,null,0,etc...)  I then have the Javascript run a Shared Procedure for the Insert into my Table.
    Here is where I am stuck.  I am confused on how to merge the delimited string into my Insert statement, from PL/SQL.
    Here is a dummied down sample of what I am trying to write.  (Shared Item is :ITEM_ARRAY, with a delimiter of ~:~ )
    DECLARE
        array APEX_APPLICATION_GLOBAL.VC_ARR2
    BEGIN
        array := APEX_UTIL.STRING_TO_TABLE(:ITEM_ARRAY, ':~:' );
        INSERT INTO tbl_blah (
            :APP_USER
            ,SYSDATE
             FOR z IN 1..array.count LOOP
                 array(z);
             END LOOP;
    END;
    Every which way I tried, I always get Not Enough Values Error.
    I tried to make everything in a delimited string as well:
    Insert Into tbl_blah (SELECT * FROM array)
    Can someone please enlighten me on the correct way to do this.  All of the examples I have seen are to write to multiple rows, via the loop.  I want to just have 1 record, horizontally.
    Thanks !!!

    Hi,
    Why can't you insert a row into table with first two columns and do update for that row???
    Just for simple work around, I have created a table with below columns,
    USER_NAME VARCHAR2 
    EXAM_DATE DATE
    M1 NUMBER
    M2 NUMBER
    M3 NUMBER
    M4 NUMBER
    M5 NUMBER
    M6 NUMBER
    M7 NUMBER
    M8 NUMBER
    M9 NUMBER
    M10 NUMBER
    I wrote a below code to insert a row into that table,
    declare
    v_arr APEX_APPLICATION_GLOBAL.VC_ARR2;
    v_stmt varchar2(1000);
    begin
    v_arr:= APEX_UTIL.STRING_TO_TABLE(:p_all_items,'~');
    insert into test_group(user_name,exam_date) values (:APP_USER,sysdate);
    dbms_output.put_line('row inserted');
    FOR i IN 1..v_arr.COUNT LOOP
    dbms_output.put_line('i='||i||' value='||v_arr(i));
    if v_arr(i) is null then
    v_stmt:='update test_group set m'||i||'=NULL';
    else
    v_stmt:='update test_group set m'||i||'='||v_arr(i);
    end if;
    dbms_output.put_line(v_stmt);
    execute immediate v_stmt;
    END loop;
    end;
    I just ran this block in 'SQL Commands', It worked for me. but i inserted only one row, so it updates a single row, In case of multiple row need to use the unique column for update. change the above code as per your requirement.
    I hope this work around will help you. If not can you please create an example in apex.oracle.com and share login credentials.
    Thanks
    Lakshmi

Maybe you are looking for

  • Problem Exporting - Append to PDF?

    Hi I have a heavy InDesign doc - Full color, many graphics etc. Size is 60MB We decided to change the size of the book, so I export to PDF, then import the pdf to new doc with new size and fit it to page. The new doc size is 80 MB For some reason, wh

  • Nokia 97 can't install 21.0.045

    I have version 20.0.019 on my Nokia 97. Telephone is reporting about new version 21.0.045. When I try to install it I get an info I should upgrade from computer. When I connect through computer Nokia software updater program reports there si NO new v

  • How to print data of selection screen

    hi plz tell me how to print that data in smartforms which the user enters in the selection screen...........

  • Can you make address labels in Pages?

    Can you make address labels in Pages?

  • Export to Quicktime Movie and end up with Final Cut document

    Exactly this is happening. Yesterday no problem, today I can not export. Using Quicktime Conversion is also hopeless. How do I remedy this? Thanks, and please be simple--I am the Idiot for which the Idiot Books were written...