How to display multiple data from different table in one table? please help

Hi
I got sun java studio creator 2(the separate installation not the one in the net beans)....
My question is about displaying data that have been taken from the database.... I know how to display data in a table(just click on the table "bind data" )... but my question is that:
when i want to use a sql statement that taken the data from different table...
how can i display that data in the table(that will be shown in the web) ??? when i click bind data on the table i can only select one table i can't select more than one....
Note:
1) i'm using the rowset for displaying the data in the table, since the sql statement is depending on a condition(i.e. select a from b where c= ? )...
2) i mean by different table is that( i.e. select a from table1,table2 )..
thanks in advance...

Hi,
937440 wrote:
Hi every one, this is my first post in this portal. Welcome to the forum!
Be sure to read the forum FAQ {message:id=9360002}
I want display the details of emp table.. for that I am using this SQL statement.
select * from emp where mgr=nvl(:mgr,mgr);
when I give the input as 7698 it is displaying the corresponding records... and also when I won't give any input then it is displaying all the records except the mgr with null values.
1)I want to display all the records when I won't give any input including nulls
2)I want to display all the records who's mgr is null
Is there any way to incorporate to include all these in a single query..It's a little unclear what you're asking.
The following query always includes rows where mgr is NULL, and when the bind variable :mgr is NULL, it displays all rows:
SELECT  *
FROM     emp
WHERE     LNNVL (mgr != :mgr)
;That is, when :mgr = 7698, it displays 6 rows, and when :mgr is NULL it displays 14 rows (assuming you're using the Oracle-supplied scott.emp table).
The following query includes rows where mgr is NULL only when the bind variable :mgr is NULL, in which case it displays all rows:
SELECT     *
FROM     emp
WHERE     :mgr     = mgr
OR       :mgr       IS NULL
;When :mgr = 7698, this displays 5 rows, and when :mgr is NULL it displays 14 rows.
The following query includes rows where mgr is NULL only when the bind variab;e :mgr is NULL, in which case it displays only the rows where mgr is NULL. That is, it treats NULL as a value:
SELECT     *
FROM     emp
WHERE     DECODE ( mgr
            , :mgr, 'OK'
            )     = 'OK'
;When :mgr = 7698, this displays 5 rows, and when :mgr is NULL, it displays 1 row.

Similar Messages

  • How to Query Multiple Fields from different Tables using Toplink Expression

    Hi,
    I am trying to prepare an Oracle Toplink Expression to qurey the multiple columns of different tables. the query as following. Please can anyone help?
    SELECT CYCLE.CYCLE_ID,
    CYCLE.ASPCUSTOMER_ID,
    CYCLE.FACILITYHEADER_ID,
    CYCLE.ADDUSER,
    ASP.FIRSTNAME || ' ' || ASP.LASTNAME ADDUSERNAME,
    CYCLE.ADDDATE,
    CYCLE.LASTUPDATEUSER,
    ASP.FIRSTNAME || ' ' || ASP.LASTNAME LASTUPDATEUSERNAME,
    CYCLE.LASTUPDATEDATE,
    CYCLE.CYCLENAME,
    CYCLE.CYCLENUMBER,
    CYCLE.DESCRIPTION
    FROM CYCLE,ASPUSER ASP
    WHERE CYCLE.ADDUSER = ASP.ASPUSER_ID
    and then i want to send that expression to readAllObjects method as a parameter
    Expression exp = (..............this is the required qurey expression...................)
    Vector employees = session.readAllObjects(getClass(), exp);
    thanks,

    You havent given any information on the mapping between Cycle and Asp. I presume there is a one to one mapping between them. Also it appears there is no "WHERE" clause to limit the number of cycles being retrieved. If that is the case then I presume you want to load all cycles in the system.
    Thats just a clientSession.readAllObjects(Cycle.class). If you have indirection turned on the Asp should get loaded when you do a cycle.getAsp().
    I presume that SQL you posted loads all the columns of CYCLE and ASP. If you are interested in a subset of CYCLE or ASP then you should do a ReportQuery or partial object read.
    Hi,
    I am trying to prepare an Oracle Toplink Expression
    to qurey the multiple columns of different tables.
    the query as following. Please can anyone help?
    SELECT CYCLE.CYCLE_ID,
    CYCLE.ASPCUSTOMER_ID,
    CYCLE.FACILITYHEADER_ID,
    CYCLE.ADDUSER,
    ASP.FIRSTNAME || ' ' || ASP.LASTNAME ADDUSERNAME,
    CYCLE.ADDDATE,
    CYCLE.LASTUPDATEUSER,
    ASP.FIRSTNAME || ' ' || ASP.LASTNAME
    LASTUPDATEUSERNAME,
    CYCLE.LASTUPDATEDATE,
    CYCLE.CYCLENAME,
    CYCLE.CYCLENUMBER,
    CYCLE.DESCRIPTION
    FROM CYCLE,ASPUSER ASP
    WHERE CYCLE.ADDUSER = ASP.ASPUSER_ID
    and then i want to send that expression to
    readAllObjects method as a parameter
    Expression exp = (..............this is the required
    qurey expression...................)
    Vector employees = session.readAllObjects(getClass(),
    exp);
    thanks,

  • How to update multiple columns from different tables using cursor.

    Hi,
    i have two tables test1 and test2. i want to udpate the column(DEPT_DSCR) of both the tables TEST1 and TEST2 using select for update and current of...using cursor.
    I have a code written as follows :
    DECLARE
    v_mydept1 TEST1.DEPT_CD%TYPE;
    v_mydept2 TEST2.DEPT_CD%TYPE;
    CURSOR C1 IS SELECT TEST1.DEPT_CD,TEST2.DEPT_CD FROM TEST1,TEST2 WHERE TEST1.DEPT_CD = TEST2.DEPT_CD AND TEST1.DEPT_CD = 'AA' FOR UPDATE OF TEST1.DEPT_DSCR,TEST2.DEPT_DSCR;
    BEGIN
    OPEN C1;
         LOOP
              FETCH C1 INTO v_mydept1,v_mydept2;
              EXIT WHEN C1%NOTFOUND;
              UPDATE TEST2 SET DEPT_DSCR = 'PLSQL1' WHERE CURRENT OF C1;
              UPDATE TEST2 SET DEPT_DSCR = 'PLSQL2' WHERE CURRENT OF C1;
         END LOOP;
         COMMIT;
    END;
    The above code when run says that it runs successfully. But it does not updates the desired columns[DEPT_DSCR].
    It only works when we want to update single or multiple columns of same table...i.e. by providing these columns after "FOR UPDATE OF"
    I am not sure what is the exact problem when we want to update multiple columns of different tables.
    Can anyone help me on this ?

    oops my mistake.....typo mistake...it should have been as follows --
    UPDATE TEST1 SET DEPT_DSCR = 'PLSQL1' WHERE CURRENT OF C1;
    UPDATE TEST2 SET DEPT_DSCR = 'PLSQL2' WHERE CURRENT OF C1;
    Now here is the upated PL/SQL code where we are trying to update columns of different tables --
    DECLARE
    v_mydept1 TEST1.DEPT_CD%TYPE;
    v_mydept2 TEST2.DEPT_CD%TYPE;
    CURSOR C1 IS SELECT TEST1.DEPT_CD,TEST2.DEPT_CD FROM TEST1,TEST2 WHERE TEST1.DEPT_CD = TEST2.DEPT_CD AND TEST1.DEPT_CD = 'AA' FOR UPDATE OF TEST1.DEPT_DSCR,TEST2.DEPT_DSCR;
    BEGIN
    OPEN C1;
    LOOP
    FETCH C1 INTO v_mydept1,v_mydept2;
    EXIT WHEN C1%NOTFOUND;
    UPDATE TEST1 SET DEPT_DSCR = 'PLSQL1' WHERE CURRENT OF C1;
    UPDATE TEST2 SET DEPT_DSCR = 'PLSQL2' WHERE CURRENT OF C1;
    END LOOP;
    COMMIT;
    END;
    Please let us know why it is not updating by using using CURRENT OF

  • How to return course  data  from different tables from a procedure

    I have a procedure which must return information from two tables:
    The sturcture of tables is as below:
    Table 1:
    id,
    name,
    property,
    type
    Table 2:
    id1
    id2 ,
    property.
    id1 of table2 refers to id attribute of table1. ie id is the foreign key for table2.
    the tables are defined such that for corresponding to each id in table1 there would
    be two or more rows in table2.
    Now in the procedure given the id, i need to retrieve information from table1 and also all the rows in table2 which refers to id2.I want to return a cursor.How can i do this.
    eg:
    if table 1 has an entry with id 2
    and table 2 has three entries with id1 referring to id(i.e id1=2)..I need to return the table1 entry with id=2 and three entires from table2 with id1=2.
    If cursors are not appropriate, what other alternative methods can be used.
    Any suggestions would be of great help.

    thanks for the reply,
    The result set would be returned to the client .....which would do further processing.The client does not even know that the data is organized in two tables..Therefore given an id, client would expect to have all the information...i.e the info from table 1 and info from table 2 where the relation ship between id and other ids are stored.
    i.e say client has id=6.This id has property,name,etc stored in table1.
    This id can further be related to any number other of ids.It can be related 2,5,100,or may be even 10000s of other ids.This mapping between the original id and other ids..are stored in table2.
    So given the id by the client , i would want to return property of the ids itself along with all the ids that it is related to .
    I want to achieve this.....

  • How to display required data from emp table?

    Hi every one, this is my first post in this portal. I want display the details of emp table.. for that I am using this SQL statement.
    select * from emp where mgr=nvl(:mgr,mgr);
    when I give the input as 7698 it is displaying the corresponding records... and also when I won't give any input then it is displaying all the records except the mgr with null values.
    1)I want to display all the records when I won't give any input including nulls
    2)I want to display all the records who's mgr is null
    Is there any way to incorporate to include all these in a single query..

    Hi,
    937440 wrote:
    Hi every one, this is my first post in this portal. Welcome to the forum!
    Be sure to read the forum FAQ {message:id=9360002}
    I want display the details of emp table.. for that I am using this SQL statement.
    select * from emp where mgr=nvl(:mgr,mgr);
    when I give the input as 7698 it is displaying the corresponding records... and also when I won't give any input then it is displaying all the records except the mgr with null values.
    1)I want to display all the records when I won't give any input including nulls
    2)I want to display all the records who's mgr is null
    Is there any way to incorporate to include all these in a single query..It's a little unclear what you're asking.
    The following query always includes rows where mgr is NULL, and when the bind variable :mgr is NULL, it displays all rows:
    SELECT  *
    FROM     emp
    WHERE     LNNVL (mgr != :mgr)
    ;That is, when :mgr = 7698, it displays 6 rows, and when :mgr is NULL it displays 14 rows (assuming you're using the Oracle-supplied scott.emp table).
    The following query includes rows where mgr is NULL only when the bind variable :mgr is NULL, in which case it displays all rows:
    SELECT     *
    FROM     emp
    WHERE     :mgr     = mgr
    OR       :mgr       IS NULL
    ;When :mgr = 7698, this displays 5 rows, and when :mgr is NULL it displays 14 rows.
    The following query includes rows where mgr is NULL only when the bind variab;e :mgr is NULL, in which case it displays only the rows where mgr is NULL. That is, it treats NULL as a value:
    SELECT     *
    FROM     emp
    WHERE     DECODE ( mgr
                , :mgr, 'OK'
                )     = 'OK'
    ;When :mgr = 7698, this displays 5 rows, and when :mgr is NULL, it displays 1 row.

  • How to retrieve multiple data from table and represent it in jsp page

    Hi
    The below JavaScript code is used to add row in the table when I want to add multiple row data into table for single entry no field.
      <html>  function addRow()
                i++;
                var newRow = document.all("tblGrid").insertRow();
                var oCell = newRow.insertCell();
                oCell.innerHTML = "<input name='srno"+i+"' type='text' id='srno"+i+"' size=10>";
                oCell = newRow.insertCell();
                oCell.innerHTML = "<input name='itmcd"+i+"' type='text' id='itmcd"+i+"' size='10'>";
                oCell = newRow.insertCell();
                oCell.innerHTML = "<input name='itmnm"+i+"' type='text' id='itmnm"+i+"' size='15'>";
                oCell = newRow.insertCell();
                oCell.innerHTML = "<input name='indentqty"+i+"' type='text' id='indentqty"+i+"' size='10'>";
                oCell = newRow.insertCell();
                    oCell.innerHTML = "<input name='uom"+i+"' type='text' id='uom"+i+"' size='10'><input type='hidden' name='mcode"+i+"'id='mcode"+i+"'>";
                oCell = newRow.insertCell();
                oCell.innerHTML = "<input name='packqty"+i+"' type='text' id='packqty"+i+"' size='10'>";
                oCell = newRow.insertCell();
                oCell.innerHTML = "<input name='packuom"+i+"' type='text' id='packuom"+i+"' size='10'><input type='hidden' name='pack"+i+"' id='pack"+i+"'>";
                oCell = newRow.insertCell();
                oCell.innerHTML = "<input name='rate"+i+"' type='text' id='rate"+i+"' size='10'>";
                oCell = newRow.insertCell();
                oCell.innerHTML = "<input name='dor"+i+"' type='text' id='dor"+i+"' size='0' onClick='"+putdate(this.name)+"'>";           
                oCell = newRow.insertCell();
                oCell.innerHTML = "<input name='bccode"+i+"' type='text' id='bccode"+i+"' size='10'></td><input type='hidden' name='bcc"+i+"' id='bcc"+i+"'>";
                oCell = newRow.insertCell();
                oCell.innerHTML = "<input name='cccode"+i+"' type='text' id='cccode"+i+"' size='10'></td><input type='hidden' name='ccc"+i+"' id='ccc"+i+"'>";
                oCell = newRow.insertCell();
                oCell.innerHTML = "<input name='remark2"+i+"' type='text' id='remark2"+i+"' size='20'>";           
                oCell = newRow.insertCell();
                oCell.innerHTML = "<input type='button' value='Delete' onclick='removeRow(this);' />";
               // oCell = newRow.insertCell();
               // oCell.innerHTML = "<input type='button' value='Clear' onclick='clearRow(this);' />";
            }<html>  Then this data are send to the next Servlet for adding into two table.
    My header portion data are added into one table which added only one row in table. while footer section data are added into the no of rows in another table dependent on No. of
    Rows added into jsp page.
    Here is an code for that logic.
    <html>
    ArrayList<String> mucode = new ArrayList<String>();
                                ArrayList<Integer> serials = new ArrayList<Integer>();
                                ArrayList<Integer> apxrate = new ArrayList<Integer>();
                                ArrayList<Integer> srname = new ArrayList<Integer>();
                                ArrayList<String> itcode = new ArrayList<String>();
                                ArrayList<String> itname = new ArrayList<String>();
                                ArrayList<Integer> iqnty = new ArrayList<Integer>();
                                ArrayList<String> iuom = new ArrayList<String>();
                                ArrayList<Integer> pqnty = new ArrayList<Integer>();
                                ArrayList<String> puom1 = new ArrayList<String>();
                               ArrayList<Integer> arate = new ArrayList<Integer>();
                                ArrayList<String> rdate = new ArrayList<String>();
                                ArrayList<String> bcs = new ArrayList<String>();
                                ArrayList<String> ccs = new ArrayList<String>();
                                ArrayList<String> remarkss = new ArrayList<String>();
                                //ArrayList<Integer> qtyrecs = new ArrayList<Integer>();
                                //ArrayList<String> dors = new ArrayList<String>();
                                //ArrayList<String> remarks = new ArrayList<String>();
                     String entryn = request.getParameter("entryno");       
                        String rows = request.getParameter("rows");
                        out.println(rows);  
                        //String Entryno = request.getParameter("entryno");
                       // out.println(Entryno);
                      int entryno = 0,reqqty = 0,srno = 0,deprequest = 0,rowcount = 0;
                                if(!Entryno.equals("")){
                                        entryno = Integer.valueOf(Entryno);
                                if(!rows.equals("")){
                                        rowcount = Integer.valueOf(rows);
                               for(int i=1;i<=rowcount;i++){
                                        if(request.getParameter("srno"+i)!=null){
                                                serials.add(Integer.valueOf(request.getParameter("srno"+i).trim()));
                                                out.println(serials.size());
                                for(int i=1;i<=rowcount;i++){
                                        if(request.getParameter("srno"+i)!=null){
                                                srname.add(Integer.valueOf(request.getParameter("srno"+i).trim()));
                                out.println(srname.get(0));
                                for(int i=1;i<=rowcount;i++){
                                        if(request.getParameter("itmcd"+i)!=null){
                                                itcode.add(request.getParameter("itmcd"+i).trim());
                                        } //out.println(itcode.get(i));
                                for(int i=1;i<=rowcount;i++){
                                        if(request.getParameter("itmnm"+i)!=null){
                                                itname.add(request.getParameter("itmnm"+i).trim());
                                        }//out.println(itname.get(i));
                                for(int i=1;i<=rowcount;i++){
                                        if(request.getParameter("indentqty"+i)!=null){
                                                iqnty.add(Integer.valueOf(request.getParameter("indentqty"+i).trim()));
                                for(int i=1;i<=rowcount;i++){
                                        if(request.getParameter("uom"+i)!=null){
                                                iuom.add(request.getParameter("uom"+i).trim());
                                        }//out.println(iuom.get(i));
                                for(int i=1;i<=rowcount;i++){
                                        if(request.getParameter("mcode"+i)!=null){
                                                mucode.add(request.getParameter("mcode"+i).trim());
                               for(int i=1;i<=rowcount;i++){
                                        if(request.getParameter("packqty"+i).equals("")){
                                          pqnty.add(0);
                                        }else
                                            pqnty.add(Integer.valueOf(request.getParameter("packqty"+i).trim()));
                                for(int i=1;i<=rowcount;i++){
                                        if(request.getParameter("pack"+i)!=null){
                                                puom1.add(request.getParameter("pack"+i).trim());
                                       }else
                                        puom1.add("");
                               for(int i=1;i<=rowcount;i++){
                                        if(request.getParameter("rate"+i).equals("")){                                     
                                            arate.add(0);
                                        }else
                                        arate.add(Integer.valueOf(request.getParameter("rate"+i).trim()));   
                     /* for(int i=1;i<=rowcount;i++){
                                        if(request.getParameter("rate"+i)!=null){
                                                arate.add(Integer.valueOf(request.getParameter("rate"+i).trim()));
                              for(int i=1;i<=rowcount;i++){
                                        if(request.getParameter("dor"+i)!=null){
                                                try{
                                                        rdate.add(dashdate.format(slashdate.parse(request.getParameter("dor"+i).trim())));
                                                }catch(ParseException p){p.printStackTrace();}
                                        }else
                                           { rdate.add("");}
                                   for(int i=1;i<=rowcount;i++){
                                 if(request.getParameter("bcc"+i)!=null){
                                                bcs.add(request.getParameter("bcc"+i).trim());
                                        }out.println(bcs.get(0));
                                for(int i=1;i<=rowcount;i++){
                                        if(request.getParameter("ccc"+i)!=null){
                                                ccs.add(request.getParameter("ccc"+i).trim());
                                        }out.println(ccs.get(0));
                                for(int i=1;i<=rowcount;i++){
                                    out.println("remark2");
                                        if(request.getParameter("remark2"+i)!=null){
                                                remarkss.add(request.getParameter("remark2"+i).trim());
                                        }out.println(remarkss.get(0));
                        ArrayList<String> Idate = new ArrayList<String>();
                        for(int i=1;i<=rowcount;i++){
                                        if(request.getParameter("dateindent"+i)!=null){
                                                try{
                                                        Idate.add(dashdate.format(dashdate.parse(request.getParameter("dateindent"+i).trim())));
                                                }catch(ParseException p){p.printStackTrace();}
                    String Rdate = dashdate.format(new java.util.Date());
                     String tdate = dashdate.format(new java.util.Date());    
                     // String Indentdate = dashdate.format(new java.util.Date());
                   //  String ApprovedT1 = dashdate.format(new java.util.Date());
                   //  String ApprovedT2 = dashdate.format(new java.util.Date());
                       // String ApprovedT1=" ";
                        //String ApprovedT2="";*/
                    String ApprovedT1= dashdate.format(new java.util.Date());
                   out.println (ApprovedT1);
                      String ApprovedT2=dashdate.format(new java.util.Date());
                       out.println(ApprovedT2);
                    String Indentdate=(dashdate.format(slashdate.parse(request.getParameter("dateindent").trim())));
                       out.println(Indentdate);
                        String Cocode ="BML001";  
                        out.println(Cocode);
                        String Deptcode = request.getParameter("dept1");
                        out.println(Deptcode);
                        String Empcode = request.getParameter("emp");
                        out.println(Empcode);
                        String Refno =request.getParameter("rtype"); 
                         out.println(Refno);
                        String Divcode = request.getParameter("todiv1");
                        out.println(Divcode);
                        String Usercode = "CIRIUS";    
                         String Whcode = request.getParameter("stor");
                        out.println(Whcode);
                        // String Itemgroupcode = request.getParameter("");
                         String Itemgroupcode ="120000";
                         out.println(Itemgroupcode);
                        String Supplytypecode = request.getParameter("stype");
                        out.println(Supplytypecode);
                        String Delcode = request.getParameter("deliverycode");
                        out.println(Delcode);
                        String Itemclass="WS";
                        out.println(Itemclass);
                        // String Itemclass = request.getParameter("iclass");
                       // out.println(Itemclass);
                        String unitcode = request.getParameter("uni");
                        out.println(unitcode);
                         String Todivcode = request.getParameter("todiv1");
                        out.println(Todivcode);
                        String Appxrate = request.getParameter("rate");
                        out.println(Appxrate);
                        String Srno = request.getParameter("srno");
                        out.println(Srno);                
                    /*    String Indqty = request.getParameter("indentqty");
                      out.println(Indqty);*/
                  String Itemcode = request.getParameter("itmcd");
                       out.println(Itemcode);
                       String Othersp = request.getParameter("remark1");
                        out.println(Othersp);
                        String Reqdt = request.getParameter("dor");
                        out.println(Reqdt);
                        String Munitcode = request.getParameter("mcode");
                        out.println(Munitcode);
                        String Packqty = request.getParameter("packqty");
                        out.println(Packqty);               
                        String Packuom = request.getParameter("pack");
                        out.println(Packuom);
                        String Remark2 = request.getParameter("remark2");
                        out.println(Remark2);
                        String BC = request.getParameter("bcc");
                        out.println(BC);
                        String CC = request.getParameter("ccc");
                        out.println(CC);
                        try{
                            st=connection.createStatement();
                            connection.setAutoCommit(false);
                            String sql="INSERT INTO PTXNINDHDR(COCODE,DEPTCODE,EMPCODE,APPROVEDT1,APPROVEDT2,INDDT,ENTRYNO,REFNO,REMARKS,DIVCODE,USERCODE,WHCODE,ITEMGROUPCODE,SUPTYPECODE,DELCODE,UNITCODE,TODIVCODE,ITEMCLASS)VALUES('"+Cocode+"','"+Deptcode+"','"+Empcode+"','"+ApprovedT1+"','"+ApprovedT2+"','"+Indentdate+"',"+Entryno+",'"+Refno+"','"+Othersp+"','"+Divcode+"','"+Usercode+"','"+Whcode+"','"+Itemgroupcode+"','"+Supplytypecode+"','"+Delcode+"','"+unitcode+"','"+Todivcode+"','"+Itemclass+"')";
                            out.println(sql);
                            st.addBatch(sql);
                            for(int i=0;i<serials.size();i++){
                                out.println("Inside the Statement");
                                String query3="test query for u";
                                out.println(query3);
                               String queryx="Insert into PTXNINDDTL(APXRATE,ENTRYNO,BRKNO,INDQTY,ITEMCODE,OTHERSPFCS,MUNITCODE,PACKQTY,PACKUOM,REMARKS,DIMSUBGRPCODE,DIMCODE,REQDT)VALUES("+arate.get(i)+","+entryno+","+srname.get(i)+","+iqnty.get(i)+","+itcode.get(i)+",'"+Othersp+"','"+mucode.get(i)+"',"+pqnty.get(i)+",'"+puom1.get(i)+"','"+remarkss.get(i)+"','"+bcs.get(i)+"','"+ccs.get(i)+"','"+rdate.get(i)+"')";
                               out.println(queryx);
                                st.addBatch(queryx);
                           int[] result=st.executeBatch();
                           connection.commit();
                           for(int k=0;k<result.length;k++)
                           out.println("rows updated by "+(k+1)+"insert sta:"+result[k]+"");
                        catch(BatchUpdateException bue)
                        out.println("error1;"+bue+"");
                        catch(SQLException sql)
                        out.println("error2;"+sql+"");
                        catch(Exception l)
                        out.println("error3;"+l+"");
    </html>
       Now I looking for to retrieve this footer section data available in multiple rows from footer table and present it in jsp page .
    I am finding difficulties in how to show this multiple row data for dynamic no of rows .i.e. variable no. of rows.
    I have able to show the data in Header portions of page in this ways
    here i am adding the part of code which shows the data from header part of table i.e from Header table
      <html>
    <h2 align="center"><b>Indent Preparation</b></h2>
        <div align="left">
            <table width="849" border="0" cellspacing="3" cellpadding="3" align="center">
                <tr>
                    <td ><div align="left"><b>Indent No.</b></div></td>
                    <td ><label>
                            <input name="indentno" type="text" id="indentno" size="15" value="" /><input type="hidden" name="no" id="no">
                    </label></td>
                    <td ><div align="center"><strong>Indent Date</strong></div></td>
                    <td ><label>
                            <div align="center">
                                <input name="dateindent" type="text" id="dateindent"value="<%=date1%>"/><input type="hidden" name="no" id="no">
                            </div>
                    </label></td>
                    <td> </td>
                    <td><div align="right"><strong>Entry No.</strong></div></td>
                     <%if(oper!=null && oper.equals("view") && hdrcode!=null && hdrdetails!=null){%>
            <td><input type="text" value="<%=hdrcode.get(3)%>" size="10"></td>
    <%}else{%>
                   <td><input type="text" name="entryno" id="entryno" value="<%=entryNo%>"/></td>
                             <%}%>
                            <div align="right"></div>
                </tr>
                <tr>
                    <td><b>Division</b></td>
                    <%if(oper!=null && oper.equals("view") && hdrcode!=null && hdrdetails!=null){%>
    <td><input type="text" value="<%=hdrdetails.get(9)%>" size="20"</td>
    <td><input type="hidden" name="div1" id="div1" value='<%=hdrcode.get(10)%>'></td>
    <%}else{%>
                   <td><input type="text" name="div" id="div" /></td>
                   <td><input type="hidden" name="div1" id="div1" /> </td>
              <%}%>
                    <td> </td>
                    <td> </td>
                    <td><div align="right"><strong>Unit</strong></div></td>
                   <%if(oper!=null && oper.equals("view") && hdrcode!=null && hdrdetails!=null){%>
    <td><input type="text" value="<%=hdrdetails.get(14)%>" size="20"</td>
    <td><input type="hidden" name="uni" id="uni" value='<%=hdrcode.get(12)%>'></td>
    <%}else{%>
                   <td><input type="text" name="unit" id="unit" /></td>
                   <td><input type="hidden" name="uni" id="uni" /> </td>
              <%}%>
                </tr>
                <tr>
    </html>
      Any suggestion on any above works is highly appreciated.
    Thanks and regards
    harshal

    Too much code. It's also not well intented nor formatted. I don't see a question either or it got lost in that heap of unformatted code.
    I will only answer the question in the thread's subject:
    How to retrieve multiple data from table and represent it in jsp pageTo retrieve, make use of HttpServletRequest#getParameterValues() and/or #getParameter().
    To display, make use of JSTL's c:forEach.

  • How to delete the data from partition table

    Hi all,
    Am very new to partition concepts in oracle..
    here my question is how to delete the data from partition table.
    is the below query will work ?
    delete from table1 partition (P_2008_1212)
    we have define range partition ...
    or help me how to delete the data from partition table.
    Thanks
    Sree

    874823 wrote:
    delete from table1 partition (P_2008_1212)This approach is wrong - as Andre pointed, this is not how partition tables should be used.
    Oracle supports different structures for data and indexes. A table can be a hash table or index organised table. It can have B+tree index. It can have bitmap indexes. It can be partitioned. Etc.
    How the table implements its structure is a physical design consideration.
    Application code should only deal with the logical data structure. How that data structure is physically implemented has no bearing on application. Does your application need to know what the indexes are and the names of the indexes,in order to use a table? Obviously not. So why then does your application need to know that the table is partitioned?
    When your application code starts referring directly to physical partitions, it needs to know HOW the table is partitioned. It needs to know WHAT partitions to use. It needs to know the names of the partitions. Etc.
    And why? All this means is increased complexity in application code as this code now needs to know and understand the physical data structure. This app code is now more complex, has more moving parts, will have more bugs, and will be more complex to maintain.
    Oracle can take an app SQL and it can determine (based on the predicates of the SQL), which partitions to use and not use for executing that SQL. All done totally transparently. The app does not need to know that the table is even partitioned.
    This is a crucial concept to understand and get right.

  • How to do a SELECT from different tables into an internal table?

    How to do a SELECT from different tables into an internal table?
    I want to select data from MARA, MARC and ZPERSON and populate my ITAB_FINAL
    REPORT  zinternal_table.
    TABLES:
      mara,
      marc,
      zperson.
    TYPES:
    BEGIN OF str_table1,
      v_name LIKE zperson-zname,
      v_matnr LIKE marc-matnr,
      v_emarc LIKE marc-emarc,
      v_werks_d LIKE marc-werks_d,
      v_dstat LIKE marc-dstat,
      END OF str_table,
      i_table1 TYPE STANDARD TABLE OF str_table1.
    DATA:
    BEGIN OF str_table2,
    v_mandt LIKE mara-mandt,
    v_ernam LIKE mara-ernam,
      v_laeda LIKE mara-laeda,
    END OF str_table2,
    itab_final LIKE STANDARD TABLE OF str_table2.

    first find the link between mara , marc and zperson , if u have link to 3 tables then u can jus write a join and populate the table u want ( thats final table with all the fields).
    u defenitely have alink between mara and marc so join them and retrieve all data into one internal table.
    then for all the entries in that internal table retrieve data from zperson into another internal table.
    then loop at one internal table
    read another internal table where key equals in both the tables.
    finally assign fileds if sy-subrc = 0.
    gs_finaltable-matnr = gs_table-matnr
    etc...
    and finally append gs_finaltable to gt_finaltable.
    there u go ur final table has all the data u want.
    regards
    Edited by: BrightSide on Apr 2, 2009 3:49 PM

  • Retriving of data from different tables

    retriving of data from different tables depening of the primary key  this key field is there in all tables   if it is there in one v table it should continue to other tables otherwise it should get exit from that it should display information message or otherwise success  message if it is there in all tables .

    Im writing the concept, just check it.
    SELECT * from kna1 into lt_kna1.
    if sy-subrc eq 0.
       selest * from lfa1 into lt_lfa1
    for all entries in lt_kna1.
    endif.

  • Fetch data from different tables print them is assigned places

    Hi Friends,
    I have designed one SMART-Form (Receipt).
    I need to fetch data from different tables and the data must be print in assigned places. Please help me how to achieve this requirement. Thanks for your help.
    Best regards,
    Manju.
    Edited by: Alvaro Tejada Galindo on Feb 12, 2008 10:20 AM

    U're right.
    When it creates a smartform it needs to decide when the main data have to be extracted:
    - or in driver program
    - or in smartforms
    The difference can be in the performance, because the program can select the data only once, the smartforms needs to extract them everytime it's called.
    I prefer to use a complex structure for the smartform interface as so all data I need are in only one structure, the problem is the complex structure is harder to be managed.
    Max

  • Procedure to check data from different tables

    Hi
    I am trying to write a procedure to compare data from a table with another.
    Table 1
    ID Name Dept
    1 ABC Y
    2 DEF Z
    Table 2
    ID Dept
    1 Y
    2 Z
    Table 3
    Name ID
    1 ABC
    2 DEF
    I would like to compare each record data in Table 1 with data from different tables table2,table3 by matching ID,name.... Please help me with how I could start writing a procedure and also spool data that does not match from the table1 with other tables
    thanks
    Edited by: 890563 on Apr 30, 2012 10:34 AM

    Hope below helps you.
    CREATE TABLE TABLE1
    (    ID          VARCHAR2(10),
         FIRST_NAME  VARCHAR2(30),
         LAST_NAME   VARCHAR2(30),
         MIDDLE_NAME VARCHAR2(30)
    INSERT INTO TABLE1 VALUES('123456','testfirst','testlast','testmiddle');
    INSERT INTO TABLE1 VALUES('123457','testfirst1','testlast1','testmiddle1');
    CREATE TABLE TABLE1
    (    ID          VARCHAR2(10),
         FIRST_NAME  VARCHAR2(30),
         LAST_NAME   VARCHAR2(30),
         MIDDLE_NAME VARCHAR2(30)
    INSERT INTO TABLE2 VALUES('123456','testfirst','testlas','testmidd');
    INSERT INTO TABLE2 VALUES('123457','testfirst2','testlast1','testmiddle1');
    SELECT TABLE1.ID,
            -- Match First Name
         CASE WHEN TABLE1.FIRST_NAME != TABLE2.FIRST_NAME THEN TABLE1.FIRST_NAME ELSE NULL END TABLE1_FIRST_NAME,
         CASE WHEN TABLE1.FIRST_NAME != TABLE2.FIRST_NAME THEN TABLE2.FIRST_NAME ELSE NULL END TABLE2_FIRST_NAME,
            -- Match Middle Name
         CASE WHEN TABLE1.MIDDLE_NAME != TABLE2.MIDDLE_NAME THEN TABLE1.MIDDLE_NAME ELSE NULL END TABLE1_MIDDLE_NAME,
            CASE WHEN TABLE1.MIDDLE_NAME != TABLE2.MIDDLE_NAME THEN TABLE2.MIDDLE_NAME ELSE NULL END TABLE2_MIDDLE_NAME,
            -- Match Last Name
         CASE WHEN TABLE1.LAST_NAME != TABLE2.LAST_NAME THEN TABLE1.LAST_NAME ELSE NULL END TABLE1_LAST_NAME,
            CASE WHEN TABLE1.LAST_NAME != TABLE2.LAST_NAME THEN TABLE2.LAST_NAME ELSE NULL END TABLE2_LAST_NAME
    FROM  TABLE1, TABLE2
    WHERE TABLE1.ID = TABLE2.ID
    ID         TABLE1_FIRST_NAME  TABLE2_FIRST_NAME  TABLE1_MIDDLE_NAME TABLE2_MIDDLE_NAME TABLE1_LAST_NAME   TABLE2_LAST_NAME
    123456     NULL               NULL               testmiddle         testmidd           testlast        testlas
    123457     testfirst1         testfirst2         NULL               NULL               NULL            NULL
    {code}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How to display retrieved data from DB on web page

    Dear all,
    how to display retrieved data from oracle database on web page,Does anyone can give me an simple example?
    thanks
    WJ

    Hi,
    I use JRun tags but you can use Oracle tags or just JDBC... First u need to install jdbs connection and set e connection by using JMC (For JRun) named nomad.
    U can also try the link below for JRun tags..
    http://wds.its.uiowa.edu/cache/docs/jrun/html/JRun_Custom_Tag_Library/contents.htm
    <%@ page import="java.sql.*,javax.sql.*,java.text.*,allaire.taglib.*" %>
    <%@ taglib uri="jruntags" prefix="jrun" %>
    <%@ page contentType="text/html; charset=ISO-8859-9" %>
    <html>
    <head>
    <title> Test Page </title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-9">
    </head>
    <body>
    <BODY BGCOLOR="#FFFFFF" LEFTMARGIN=15 TOPMARGIN=20 >
    <jrun:sql datasrc="nomad" id="q1">
    select empno,
         ename
    from emp
    order by ename
    </jrun:sql>
    <center>
    <table border = 0 cellpadding = 3 cellspacing = 1>
         <th>EmployeeNo</th><th>Name</th>
    <jrun:param id="q1" type="QueryTable"/>
    <jrun:foreach group="<%= q1 %>">
                   <tr>
                   <td> <%= q1.get(1) %> </td>
                   <td> <%= q1.get(2) %> </td>
                   </tr>
    </jrun:foreach>
    </table>
    </center>
    </body>
    </html>
    ----------------------

  • How to get the data from Pooled Table T157E.

    Hi Experts,
    How to get the data from Pooled Table T157E.
    Any help.
    Thanks in Advance,
    Ur's Harsha.

    create some internal table similar to T157E and pass all data as per SPRAS.
    After that use internal table in your program as per the requirement.
    Regds,
    Anil

  • How to export some data from the tables of an owner with integrity?

    Hi to all,
    How to export some data from the tables of an owner with integrity?
    I want to bring some data from all tables in a single owner of the production database for development environment.
    My initial requirements are: seeking information on company code (emp), contract status (status) and / or effective date of contract settlement (dt_liq_efetiva) - a small amount of data to developers.
    These three fields are present in the main system table (the table of contracts). Then I thought about ...
    - create a temporary table from the query results table to contract;
    - and then use this temporary table as a reference to fetch the data in other tables of the owner while maintaining integrity. But how? I have not found the answer, because: what to do when not there is the possibility of a join between the contract and any other table?
    I am considering the possibility of consulting the names of tables, foreign keys and columns above, and create dynamic SQL. Conceptually, something like:
    select r.constraint_name "FK name",
    r.table_name "FK table",
    r.column_name "FK column",
    up.constraint_name "Referencing name",
    up.table_name "Referencing table",
    up.column_name "Referencing column"
    from all_cons_columns up
    join all_cons_columns r
    using (owner, position), (select r.owner,
    r.constraint_name fk,
    r.table_name table_fk,
    r.r_constraint_name r,
    up.table_name table_r
    from all_constraints up, all_constraints r
    where r.r_owner = up.owner
    and r.r_constraint_name = up.constraint_name
    and up.constraint_type in ('P', 'U')
    and r.constraint_type = 'R'
    and r.owner = 'OWNERNAME') aux
    where r.constraint_name = aux.fk
    and r.table_name = aux.table_fk
    and up.constraint_name = aux.r
    and up.table_name = aux.table_r;
    -- + Dynamic SQL
    If anyone has any suggestions and / or reuse code to me thank you very much!
    After resolving this standoff intend to mount the inserts in utl_file by a table and create another program to read and play in the development environment.
    Thinking...
    Let's Share!
    My thanks in advance,
    Philips

    Thanks, Peter.
    Well, I am working with release 9.2.0.8.0. But the planning is migrate to 10g this year. So my questions are:
    With Data Pump can export data just from tables owned for me (SCHEMAS = MYOWNER) parameterizing the volume of data (SAMPLE) and filters to table (QUERY), right? But parameterizing a contract table QUERY = "WHERE status NOT IN (2,6) ORDER BY contract ":
    1º- the Data Pump automatically searches for related data in other tables in the owner? ex. parcel table has X records related (fk) with Y contracts not in (2,6): X * SAMPLE records will be randomly exported?
    2º- for the tables without relation (fk) and which are within the owner (MYOWNER) the data is exported only based on the parameter SAMPLE?
    Once again, thank you,
    Philips
    Reading Oracle Docs...

  • How can i extract data from oracle table  to flat file or excel spread shee

    Hello,
    DB Version is 10.1.0.3.0
    How can i extract data from oracle table to flat file or excel spread sheet by using sub programs?
    Regards,
    D

    Here what I did
    SET NEWPAGE 0
    SET SPACE 0
    SET LINESIZE 80
    SET PAGESIZE 0
    SET ECHO OFF
    SET FEEDBACK OFF
    SET VERIFY OFF
    SET HEADING OFF
    SET MARKUP HTML OFF SPOOL OFF
    Sql> SPOOL bing
    select * from -------;
    SPOOL OFF;
    I do not see file.
    I also tried
    Sql> SPOOL /tmp/bing
    select * from -------;
    SPOOL OFF;
    But still not seeing the fie,

Maybe you are looking for

  • In which jar file SAP NW(EP) connector class available

    hi i want to know in which jar file the javaconnector class is available and i'm developing one plugin to connect sap ep to sap km repository to fetch docs from repository. for this i need some java classes so pls help me out from this problem..... r

  • Head Office account in FBL5N

    Hi there! We have an head office account. When we viewed it in FBL5N with the following paramters: Customer, Company code and Open item as of xx.xx.xxxx. The result of which for example is 50000USD. Then we tried to use FBL5N but with different param

  • STO Return Delivery

    Hi Gurus, Plant A orders for 100 Qty(STO) to Plant B of the same company code C. Plant B supplies 100 Qty,But 20 Qty are damaged. Plant A, Returns that 20 Qty to Plant B. Now My Q is,how will u receive that 20 qty in Plant B,What is the Movement type

  • Apple Wired keyboard with numeric keypad works for 10.5.6??

    Hello! I have a iBook G4 1 Ghz 256 mb of ram. I want the apple wired keyboard With numeric keypad. My iBook is running 10.5.6. Would this work on leopard? I don't care if the launch pad and mission control keys don't work since I have leopard. Howeve

  • App Store will not update to 10.2.3

    I am having trouble with the App Store recognizing and downloading the update to OS 10.2.3.  It worked fine on my MacBook Air, but is giving the following problems on my Mac Pro and iMac, both of which are running 10.2.2: 1  Either the Updates page j