Using null to replace values

I'm a newbie! Can you tell me how can replace existing values in a variable. My plot in the program is to have the price of products in my right hand then transfer that to the cart and then to cashier lady. I have to make sure and know that when I transfer the price from my right hand to the value cart the right hand should no value, then when from cart to the cashier the cart should have no value. The code below is not yet finish. I'm just testing it on one product. I just to know the transferring concept. Can I use null?
This my are codes:
the customer class
public class customer{
     String fullName,walletName;
     double wallet,money;
     public void sayName(){
          System.out.println(fullName + " is inside the grocery");
     public String giveFullName(){
          return fullName;
     public void sayWalletBrand(){
          System.out.println("Let me see how much money I got from my " + walletName + " wallet\n");
     public void contentWallet(double money){
          wallet = money;
     public void lookWallet(){
          System.out.println("Show that wallet has the value " + wallet);
          System.out.println();
the product class:
public class product{
     String description;
     double price,rightHand;
     public double containRightHand(){
          rightHand = price;
          System.out.println(rightHand);
          System.out.println();
          return rightHand;
     public void showDescription(){
          System.out.println("Show product description " + description);
     public void showPrice(){
          System.out.println("Show the product price value " + price);
          System.out.println();
the cart class:
public class cart extends product{
     double contents[] = new double[2];
     product doritos,apple;
     //Movement method from rightHand to cart
     public double getProduct1(product doritos){
          contents[0] = doritos.containRightHand();
          return contents[0];
     public double getProduct2(product apple){
          contents[1] = apple.containRightHand();
          return contents[1];
     public void showProduct1(){
          System.out.println("Show that contents[0] has the value "+ contents[0]);
     public void showProduct2(){
          System.out.println("Show that contents[1] has the value "+ contents[1]);
the cashier class:
public class cashier{
     customer cashierLady;
     public void tellNameCashier(customer cashierLady){
          System.out.println("Shows the name of the cashier lady named " + cashierLady.giveFullName());
the main:
public class grocery{
     public static void main(String []arg){
          customer Peter, Lady;
          Peter = new customer();
          Peter.fullName = "Raymond Malicdem";
          Peter.walletName = "Seiko";
          Peter.wallet = 1000.0;
          Peter.sayName();
          Peter.sayWalletBrand();
          Peter.contentWallet(1000.0);
          Peter.lookWallet();
          product Doritos = new product();
          Doritos.description = "Junk Food";
          Doritos.price = 60.0;
          Doritos.showDescription();
          Doritos.showPrice();
          Doritos.containRightHand();
          cart product1 = new cart();
          product1.getProduct1(Doritos);
          product1.showProduct1();
          Lady = new customer();
          Lady.fullName = "Christine";
          cashier lady = new cashier();
          lady.tellNameCashier(Lady);

Variables of object (class) types may be set to null, meaning they point to no object.
Variables of fundamental types (int, byte, char, long, double, float, boolean, etc.) can not be set to null. Maybe you can set your numeric types to 0 and boolean to false, to indicate nothingness.

Similar Messages

  • Avoiding null and duplicate values using model clause

    Hi,
    I am trying to use model clause to get comma seperated list of data : following is the scenario:
    testuser>select * from test1;
    ID VALUE
    1 Value1
    2 Value2
    3 Value3
    4 Value4
    5 Value4
    6
    7 value5
    8
    8 rows selected.
    the query I have is:
    testuser>with src as (
    2 select distinct id,value
    3 from test1
    4 ),
    5 t as (
    6 select distinct substr(value,2) value
    7 from src
    8 model
    9 ignore nav
    10 dimension by (id)
    11 measures (cast(value as varchar2(100)) value)
    12 rules
    13 (
    14 value[any] order by id =
    15 value[cv()-1] || ',' || value[cv()]
    16 )
    17 )
    18 select max(value) oneline
    19 from t;
    ONELINE
    Value1,Value2,Value3,Value4,Value4,,value5,
    what I find is that this query has duplicate value and null (',,') coming in as data has null and duplicate value. Is there a way i can avoid the null and the duplicate values in the query output?
    thanks,
    Edited by: orausern on Feb 19, 2010 5:05 AM

    Hi,
    Try this code.
    with
    t as ( select substr(value,2)value,ind
            from test1
            model
            ignore nav
            dimension by (id)
            measures (cast(value as varchar2(100)) value, 0 ind)
            rules
            ( ind[any]=  instr(value[cv()-1],value[cv()]),
            value[any] order by id = value[cv()-1] || CASE WHEN value[cv()] IS NOT NULL
                                               and ind[cv()]=0     THEN ',' || value[cv()] END      
    select max(value) oneline
    from t;
    SQL> select * from test1;
            ID VALUE
             1 Value1
             2 Value2
             3 Value3
             4 Value4
             5 Value4
             6
             7 value5
             8
    8 ligne(s) sélectionnée(s).
    SQL> with
      2   t as ( select substr(value,2)value,ind
      3          from test1
      4          model
      5          ignore nav
      6          dimension by (id)
      7          measures (cast(value as varchar2(100)) value, 0 ind)
      8          rules
      9          ( ind[any]=  instr(value[cv()-1],value[cv()]),
    10          value[any] order by id = value[cv()-1] || CASE WHEN value[cv()] IS NOT NULL
    11                                             and ind[cv()]=0     THEN ',' || value[cv()] END 
    12          )
    13        )
    14   select max(value) oneline
    15   from t;
    ONELINE
    Value1,Value2,Value3,Value4,value5
    SQL>

  • From two given tables, how do you fetch the values from two columns using values from one column(get values from col.A if col.A is not null and get values from col.B if col.A is null)?

    From two given tables, how do you fetch the values from two columns using values from one column(get values from col.A if col.A is not null and get values from col.B if col.A is null)?

    Hi,
    Use NVL or COALESCE:
    NVL (col_a, col_b)
    Returns col_a if col_a is not NULL; otherwise, it returns col_b.
    Col_a and col_b must have similar (if not identical) datatypes; for example, if col_a is a DATE, then col_b can be another DATE or it can be a TIMESTAMP, but it can't be a VARCHAR2.
    For more about NVL and COALESCE, see the SQL Language manual: http://docs.oracle.com/cd/E11882_01/server.112/e26088/functions119.htm#sthref1310
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables involved, and also post the results you want from that data.
    Explain, using specific examples, how you get those results from that data.
    Always say which version of Oracle you're using (e.g., 11.2.0.2.0).
    See the forum FAQ: https://forums.oracle.com/message/9362002

  • Using null value of item

    Hi All,
    I use this part-of-code in pl/sql statement in a 'where' clause in order to filter records to those that took place between some hours range:
    ..... and to_char(STARTDATE,'HH24:MI:SS') between NVL(:P3_HOURS_FROM,'00:00:00') and NVL(:P3_HOURS_TO,'23:59:59')
    P3_HOURS_FROM & P3_HOURS_TO are combo box items with LOV (0:00,0:30,1:00 ....etc that returns 00:00:00,00:30:00,1:00:00 respectively). I use a null value which is displayed as '--:--'.
    when i choose some hour range the rsults are correct. the problem is when i choose null values. there is no results to the report, probably (i guess) because it somehow translate the (null) time value to the same value (and it's obvious that between same time values there isn't any result).
    so i guess i use 'null' value in an inappropriate way.
    Can u tell me what do i do wrong???

    Are you sure you are returning NULL and just displaying '--:--' in your LOV?
    If the state of your LOV is becoming '--:--' then this does not equal null in PL/SQL land.
    I presume you are also submitting after changing your LOVs?
    You can check the state of your items by clicking the session state in the developers toolbar at the bottom. See what your items are being set and report back!
    Ben

  • Using null values to change text boxes

    Very simple question I believe.
    I have a form with rows of data.  All I want to do is say that if a given field in a row "description1" is not Null, then populate another field with a specified value.
    jA

    if (descriptionFieldName.rawValue != null){
      otherFieldName.rawValue = "value you want to give it";
    If there are multiple rows of this information you will have to add the row subform to the expression as well as an occurance number so it wil know which one you want . I will use i to indicate the occurance:
    if (Row(i).descriptionFieldName.rawValue != null){
       Row(i).otherFieldName.rawValue = "value you want tto give it";
    Paul

  • How to include NULL in multi value parameters

    Good Morning,
    I'm posting this question after i tried other links and was not successful. I'm using a report builder to create a report. SSRS2008R2.
    I have a sql to get the data into the data set. Source is ORACLE DB. The query is pulling lastname,firstname,dob,joindt,divname. I created a parameter in the SQL :
    WHERE DIVNAME IN (:divname).
    I created another dataset (select distinct divname from table2) and selected the paramter properties to get the values from the second dataset and selected it to be multivalued. However the user wants to see the NULL's or BLANKS that are in the DIVNAME.
    Can some one please tell me as how i can acheive this?
    When i run the query in the sql plus i get (null) values as well, but when in the second dataset i run the query i just get the DISTINCT divnames and a  "BLANK" field (in SSRS)
    Thanks

    Hi thinkingeye,
    According to your description, you want to include the null values in your multiple values parameter. Right?
    In Reporting Services, we can't allow both null values and multiple values in a parameter. In this scenario, since you have created a dataset for getting distinct divname, we suggest you try "select distinct isnull(divname,-1) from [table]" in this
    dataset so that all the null values will return -1. Also using isnull() function to replace divname in other query. This might be the most effective work around.
    Reference:
    Null and Multi-value parameter possible
    Include Null Value Multi-Value Parameter list
    If you have any question, please feel free to ask.
    Best Regards,
    Simon Hou

  • HowTo: Replace values in Entity, best practice

    I was reading jsr-220 and now I have a question.
    What is the best practice to replace values in an entity?
    For example I have an entity Person:
    @Table(name = "Person", schema = SCHEMA)
    public class Person{
         @Id
         @GeneratedValue
         private int id;
         private String sourceUri;
           @ManyToMany(fetch=FetchType.EAGER, cascade={CascadeType.MERGE, CascadeType.REFRESH, CascadeType.PERSIST} )
         private List<Representative> representatives;
         @OrderBy("date")
         @ManyToMany(fetch=FetchType.EAGER, cascade={CascadeType.ALL}, mappedBy="person")
            private List<PersonAccessCounter> counter;
         @OneToMany(fetch=FetchType.EAGER, cascade={CascadeType.ALL}, mappedBy="person")
         private List<EducationLevel> educationLevels;
          //some other fileds + getters/setters
    }As you can see, my Person has autoGenerated id. But also it has other "unformal" identity field: sourceUri
    Imagine such situation:
    I've persisted a Person. While system was in use, it's id points to some other entities. So I can't loose it.
    Then, my special crawler gathered new info about person.
    Using sourceUri of Person(crawler has provided it) I can select already persisted person from DB.
    Now, my task is to completely remove some fields (this data must disappear from DB, totally, no orphaned links) from persisted person and replace them with values from new person gathered by crawler.
    What's better?
    1. Find persitedPerson using sourceUri
    2. Replace some fields of persitedPerson with new values taken from crawledPerson.
    3. em.merge(persistedPerson)
    OR
    1. Find persitedPerson using sourceUri.
    2. Set some fields of persitedPerson to NULL
    3. Merge persitedPerson
    4. Set new values to persitedPerson taken from crawledPerson.
    3. em.merge(persistedPerson)
    Seems like the first variant is enough. It will fork fine if annotations were set correctly (cascade={CascadeType.ALL} and other)
    Edited by: Holod on 10.11.2008 16:32
    Edited by: Holod on 10.11.2008 16:46

    I was reading jsr-220 and now I have a question.
    What is the best practice to replace values in an entity?
    For example I have an entity Person:
    @Table(name = "Person", schema = SCHEMA)
    public class Person{
         @Id
         @GeneratedValue
         private int id;
         private String sourceUri;
           @ManyToMany(fetch=FetchType.EAGER, cascade={CascadeType.MERGE, CascadeType.REFRESH, CascadeType.PERSIST} )
         private List<Representative> representatives;
         @OrderBy("date")
         @ManyToMany(fetch=FetchType.EAGER, cascade={CascadeType.ALL}, mappedBy="person")
            private List<PersonAccessCounter> counter;
         @OneToMany(fetch=FetchType.EAGER, cascade={CascadeType.ALL}, mappedBy="person")
         private List<EducationLevel> educationLevels;
          //some other fileds + getters/setters
    }As you can see, my Person has autoGenerated id. But also it has other "unformal" identity field: sourceUri
    Imagine such situation:
    I've persisted a Person. While system was in use, it's id points to some other entities. So I can't loose it.
    Then, my special crawler gathered new info about person.
    Using sourceUri of Person(crawler has provided it) I can select already persisted person from DB.
    Now, my task is to completely remove some fields (this data must disappear from DB, totally, no orphaned links) from persisted person and replace them with values from new person gathered by crawler.
    What's better?
    1. Find persitedPerson using sourceUri
    2. Replace some fields of persitedPerson with new values taken from crawledPerson.
    3. em.merge(persistedPerson)
    OR
    1. Find persitedPerson using sourceUri.
    2. Set some fields of persitedPerson to NULL
    3. Merge persitedPerson
    4. Set new values to persitedPerson taken from crawledPerson.
    3. em.merge(persistedPerson)
    Seems like the first variant is enough. It will fork fine if annotations were set correctly (cascade={CascadeType.ALL} and other)
    Edited by: Holod on 10.11.2008 16:32
    Edited by: Holod on 10.11.2008 16:46

  • Using NULL and NOT NULL in prompted filters

    Dear all,
    While trying to grap the concept of prompted filters in sap bo web intelligence, I had a question whether why we cannot use NULL and NOT NULL while creating a prompted filters in our report.

    HI,
    'Is Null' and 'Not Null' are the predefined functions in webi which only eliminate the null values or considering only null values.
    'Is Null' and 'Not Null' are itself predefined functions that why you are not getting  prompts.
    Null values are standard across the databases so this is defined  as a function in webi to specific eliminate the null values.
    If something is not standard then there is option in the webi to use different operator with static values or with prompts.
    More more information on Null see the Null wiki page.
    Null (SQL) - Wikipedia, the free encyclopedia
    Amit

  • Replaced value is not getting relected in IDOC segment field

    Hi,
    Need your help for the below issue.
    I am replacing the PO # with Delivery Doc # . But the replaced value is not getting reflected in the IDOC segment field(e1bp2017_gm_item_create-po_number.).
    Function Module  which I am using is IDOC_INPUT_MBGMCR as a copy.
    Here is my code given below:
    SELECT
                SINGLE vbeln
                  INTO lx_vbeln
                  FROM lips
                 WHERE vgbel EQ e1bp2017_gm_item_create-po_number.
    Move lx_vbeln TO e1bp2017_gm_item_create-po_number.
    MOVE-CORRESPONDING e1bp2017_gm_item_create
                   TO goodsmvt_item.
    Then this is passed as  TABLE in "BAPI_GOODSMVT_CREATE".
    Please do the needful.

    Hi Dheepa,
    Check it in debug whether the filed is empty or having po#, when ur code is executed for the replacement. if it is empty, po# is populated after ur code. in this case you need to write the code in suitable place.
    Reddy

  • System.Exception: null or empty values

    Have designed a 4 part form Using DW MX, ASP.NET C# and MySQL
    and currently getting the below error when moving from one page to
    the next.
    The web.config file is on the server, there are no null or
    empty values, and the key tags match.
    I am new to applicaiton development in DW and am now stuck -
    any suggestions?
    System.Exception: This page has a MM:DataSet, MM:Insert,
    MM:Update or MM:Delete tag with a null or empty value for the
    ConnectionString and DatabaseType attributes.
    Often, such values come from application settings in the
    web.config file. That file might be missing from the server
    executing this page. Or, it might be missing the particular add key
    tags for the database connection this page uses. If you are using
    Dreamweaver, look for the web.config file in the local root folder
    of your Dreamweaver site. Once you find this file, you can either:
    Put this file onto the server that is executing this page.
    Copy the add key tags from the web.config in the local root
    folder of your Dreamweaver site and paste them into the web.config
    file in the server that is executing this page.
    at DreamweaverCtrls.DataSet.DoInit()
    Text

    http://java.sun.com/docs/books/tutorial/uiswing/components/spinner.html#model
    Might be a good start.

  • How to define null or empty value in BAPI function modules?

    Hi,
    I have problem with BAPI functions, where some parameters are mandatory.
    For example: when I try to use HR BAPI's(BAPI_PERSDATA_CHANGE, etc.) I have to insert parameters like SUBTYPE,OBJECTID,LOCKINDICATOR. The PA0002 table that is used from this BAPI doesn't have SUBTYPE, OBJECTID, LOCKINDICATOR, for any of the records that I would like to select.
    So what I tried, was to put a ' ', to indicate that is empty. It returned an error message saying "Make an entry in all required fields". Next tried to put in some values for these fields -- and it returned an error message saying "No data selected from 0002 for this period".
    I also tried to run BAPI_FAMILY_CHANGE that uses data from table PA0021. Here I found some records with  SUBTYPE, OBJECTID fields that were not empty, but LOCKINDICATOR was still missing. So I tried to put LOCINDICATOR value directly in to database (with MS SQL Enterprise Manager).  After that I was able to use BAPI_FAMILY_CHANGE.
    I think that manually inserting data in database is not normal procedure.
    Is there something that I have missed out?
    I mean -- how can I get this to work without inserting data directly in database?
    How can I define null or empty value in BAPI function modules?
    Thank you in advance.
    Best regards,
    Mihail

    Defining an empty value for a parm in a table is easy.
    First get the function's definition from the SAP system
    Second only populate the fields for which you have a value to set
    Third execute the function.
    The JCO takes care of the rest.
    Enjoy

  • Union two tables with diffrent count of fields with null and float value

    Hello,
    i want to union two tables, first one with 3 fields and second one with 4 fields (diffrent count of fields).
    I can add null value at end of first select but it does not work with float values in second table. Value form second table is convert to integer.
    For example:
    select null v1 from sessions
    union
    select 0.05 v1 from sessions
    result is set of null and 0 value.
    As workaround i can type:
    select null+0.0 v1 from sessions
    union
    select 0.05 v1 from sessions
    or simple change select's order.
    Is any better/proper way to do this? Can I somehow set float field type in first select?
    Best regards,
    Lukasz.
    WIN XP, MAXDB 7.6.03

    Hi Lukasz,
    in a UNION statement the first statement defines the structure (number, names and types of fields) of the resultset.
    Therefore you have to define a FLOAT field in the first SELECT statement in order to avoid conversion to VARCHAR.
    Be aware that NULL and 0.0 are not the same thus NULL+0.0 does not equal NULL.
    In fact NULL cannot equal to any number or character value at all.
    BTW: you may want to use UNION ALL to avoid the search and removal of duplicates - looks like your datasets won't contain duplicates anyhow...
    Regards,
    Lars

  • Find and replace value in Delimited String

    Hi All,
    I have a requirement, where i need to find and replace values in delimited string.
    For example, the string is "GL~1001~157747~FEB-13~CREDIT~A~N~USD~NULL~". The 4th column gives month and year. I need to replace it with previous month name. For example: "GL~1001~157747~JAN-13~CREDIT~A~N~USD~NULL~". I need to do same for last 12 months.
    I thought of first devide the values and store it in variable and then after replacing it with required value, join it back.
    I just wanted to know if there is any better way to do it?

    for example (Assumption: the abbreviated month is the first occurance of 3 consecutive alphabetic charachters)
    with testdata as (
    select 'GL~1001~157747~FEB-13~CREDIT~A~N~USD~NULL~' str from dual
    select
    str
    ,regexp_substr(str, '[[:alpha:]]{3}') part
    ,to_date('01'||regexp_substr(str, '[[:alpha:]]{3}')||'2013', 'DDMONYYYY') part_date
    ,replace (str
             ,regexp_substr(str, '[[:alpha:]]{3}')
             ,to_char(add_months(to_date('01'||regexp_substr(str, '[[:alpha:]]{3}')||'2013', 'DDMONYYYY'),-1),'MON')
    ) res
    from testdata
    STR
    PART
    PART_DATE
    RES
    GL~1001~157747~FEB-13~CREDIT~A~N~USD~NULL~
    FEB
    02/01/2013
    GL~1001~157747~JAN-13~CREDIT~A~N~USD~NULL~
    with year included
    with testdata as (
    select 'GL~1001~157747~JAN-13~CREDIT~A~N~USD~NULL~' str from dual
    select
    str
    ,regexp_substr(str, '[[:alpha:]]{3}-\d{2}') part
    ,to_date(regexp_substr(str, '[[:alpha:]]{3}-\d{2}'), 'MON-YY') part_date
    ,replace (str
             ,regexp_substr(str, '[[:alpha:]]{3}-\d{2}')
             ,to_char(add_months(to_date(regexp_substr(str, '[[:alpha:]]{3}-\d{2}'), 'MON-YY'),-1),'MON-YY')
    ) res
    from testdata
    STR
    PART
    PART_DATE
    RES
    GL~1001~157747~JAN-13~CREDIT~A~N~USD~NULL~
    JAN-13
    01/01/2013
    GL~1001~157747~DEC-12~CREDIT~A~N~USD~NULL~
    Message was edited by: chris227 year included

  • Using null for parameterized "newInstance(Object [])" method in Object[].

    I have a really serious problem. I am creating instances of specific classes by using reflection techniques. I am reading a flat file, finding class from its name and creating it by using its parameterized constructor. Example:
    line 1: Dummy("A",Dummy2("B"),12,,"C");
    I create an instance of Dummy with parameters "A", an instance of Dummy2 object with value "B", 12 (I use here Integer as wrapper), null (There is no wrapper for null :( ) and "C".
    I find constructor by using findConstructors() and looking their parameter counts, creating an object array with given values and calling:
    constructorIFoundBefore.newInstance(objectArrayIPrepared);
    But!!!
    Because I use null directly, I got this message:
    java.lang.IllegalArgumentException: argument type mismatch
         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
         at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
         at reader.parser.ObjectCreator.createObjectFromObjectItem(ObjectCreator.java:192)
         at reader.parser.ObjectCreator.createObjectFromParseItem(ObjectCreator.java:112)
         at reader.parser.ObjectCreator.createObject(ObjectCreator.java:78)
         at reader.analyzer.FileAnalyzer.analyzeAndCreateObjects(FileAnalyzer.java:95)
         at reader.ReverseReader.main(ReverseReader.java:43)
    I will be very glad if you help me.
    Thanks a lot!
    Gokcer

    I said something wrong. Sorry. While invoking a method (or a constructor) we need an object array which are equivalent to parameters. For example to call a method or constructor for class A;
    class A {
    int age;
    String name;
    public A(int age, String name){
    this.age = age;
    this.name = name;
    public set(int age, String name){
    this.age = age;
    this.name = name;
    we use in any place
    A a1 = new A(12,"Gokcer");
    A a2 = new A(15,null);
    To achieve this by using reflection techniques, we must find constructor with two parameters of class A. At this point "BetterMethodFinder" will give great help.
    After finding right constructor, we must create an object array to tell the constructor parameters (age and name). At this point we need an object array which stores our parameters. Code must be like this.
    Object []params = new Object[2]; // we have two parameters.
    params[0] = new Integer(12); // we can't use params[0]=12
    // because 12 is not an object. (It is a
    // primitive type)
    params[1] = "Gokcer";
    Now create the new object.
    A a1;
    a1 = constructorWeFound.newInstance(params);
    While creating param[], we could also use:
    Object []params = new Object[2] {new Integer(12),"Gokcer"};
    While creating a2, we can use "null" directly for second parameter.
    params = new Object[2] = {new Integer(15), null};
    or
    Object []params = new Object[2];
    params[0] = new Integer(15);params[1] = null;
    Thanks again everyone who replied me.
    My sincerely...

  • How to use Ajax Get Multiple Values in Tabular form?

    Hi All-
    I am trying to use AJAX to get multiple values in tabular form by using Denes Kubicek's example 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 populate rest of the values on the form.
    I have created the example(Ajax Get Multiple Values, application 54522) on Oracle site -
    http://apex.oracle.com/pls/apex/f?p=4550:1:0:::::
    Workspace: iConnect
    login: demo
    password: demo
    I was able to duplicate his example on page 1 (home page).
    However, I want to use system generate tabular form to finish this example, and was not able to populate the data correctly.
    Page 2 (method 2) is the one that I am having trouble to populate the column values. When I checked application item values in Session, and the values seems to be populated correctly.
    This is what I have done 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 application items - TEMPORARY_APPLICATION_ITEM2, T_ROWNUM2
    3. Put the following 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. Tabular form query:
    select
    "BOOK_ID",
    "BOOK",
    "SUBJECT",
    "PRICE",
    "AUTHOR",
    "QTY",
    "BOOK_ID" BOOK_ID_DISPLAY
    from "#OWNER#"."MY_BOOK_STORE"
    5. In Book_ID_DISPLAY column attribute:
    Add the following code to element attributes: onchange="javascript:f_set_multi_items_tabular2(this.value,'#ROWNUM#');"
    Changed to -> onchange="javascript:setLOV(this,'f03');"
    Now,  T_ROWNUM2 returns value as f03_0001. But, TEMPORARY_APPLICATION_ITEM2 returns as [object HTMLSelectElement]...
    Please help me to see how I can populate the data with this tabular form format. Thanks a lot in advanced!!!
    Ling
    Updated code in Red..

    Ling
    Lets start with looking at what the javascript code is doing.
    function f_set_multi_items_tabular(pValue, pRow){
      /*This will initiate the url for the demand process to run*/
      var get = new htmldb_Get(null,html_GetElement('pFlowId').value,
                              'APPLICATION_PROCESS=Set_Multi_Items_Tabular',0);
      if(pValue){
        /*If there is an value than submit item name with value*/
        get.add('TEMPORARY_APPLICATION_ITEM',pValue)
        get.add('T_ROWNUM',pRow)
      }else{
        /*Else set the item TEMPORARY_APPLICATION_ITEM to null*/
        get.add('TEMPORARY_APPLICATION_ITEM','null')
      /*Submit the url and te returned document is of type XML*/
      gReturn = get.get('XML');
      if(gReturn){
        /*There is something returned*/
        var l_Count = gReturn.getElementsByTagName("item").length;
        /*For all elements of the tag item*/
        for(var i = 0;i<l_Count;i++){
          /*Get the item out of the XML*/
          var l_Opt_Xml = gReturn.getElementsByTagName("item")[i];
          /*Get the id of the item*/
          var l_ID = l_Opt_Xml.getAttribute('id');
          /*Get the element in the original page with the same id as
          **the item we have in the XML produced by the ondemand process
          var l_El = html_GetElement(l_ID);
          /*Now get the value of the item form the XML*/
          if(l_Opt_Xml.firstChild){
            var l_Value = l_Opt_Xml.firstChild.nodeValue;
          }else{
            /*There is no value*/
            var l_Value = '';
          if(l_El){
            /*There is an element with the same id as the item we are processing*/
            if(l_El.tagName == 'INPUT'){
              /*The element is an input item just set the value*/
              l_El.value = l_Value;
            }else if(l_El.tagName == 'SPAN' && l_El.className == 'grabber'){
              /*If it is a span elment and has the class grabber
              **Then set the innerHTML of the parent to the value
              **and the id of the parent to the id
              l_El.parentNode.innerHTML = l_Value;
              l_El.parentNode.id = l_ID;
            }else{
              /*Else set the value as innerHTML*/
              l_El.innerHTML = l_Value;
      get = null;
    Now where it went wrong in your initial post
    The XML that was returned by your XML process would be something like
    <body>
      <desc>this xml genericly sets multiple items</desc>
      <item id="f02_1">CSS Mastery</item>
      <item id="f03_1">22</item>
      <item id="f04_1">Andy Budd</item>
      <item id="f05_1">1</item>
    </body>
    When you don't use apex_item to create your tabular form a item in the table will look like
    <input id="f02_0001" type="text" value="CSS Mastery" maxlength="2000" size="16" name="f05" autocomplete="off">
    Notice the id's f02_1 and f02_0001 don't match.
    So to make it work the XML would have to look like
    <body>
      <desc>this xml genericly sets multiple items</desc>
      <item id="f02_0001">CSS Mastery</item>
      <item id="f03_0001">22</item>
      <item id="f04_0001">Andy Budd</item>
      <item id="f05_0001">1</item>
    </body>
    To do that simply use lpad in the ondemand process like
    HTP.prn ('<item id="f02_' || lpad(:t_rownum,4,'0') || '">' || v_subject || '</item>');
    HTP.prn ('<item id="f03_' || lpad(:t_rownum,4,'0') || '">' || v_price || '</item>');
    HTP.prn ('<item id="f04_' || lpad(:t_rownum,4,'0') || '">' || v_author || '</item>');
    HTP.prn ('<item id="f05_' || lpad(:t_rownum,4,'0') || '">' || v_qty || '</item>');
    Keep in mind that the above is based on your original post and #ROWNUM# not being lpadded with zero's.
    Nicolette

Maybe you are looking for