Query data with some value & display in datatable at page

hi,
I have bean and when user enter some page i use datatable to display some data from oracle:
<h:dataTable id="dt1" value="#{GetDataOracle.rep_tcok_pl2_connects}" var="item" bgcolor="#F1F1F1" border="10" cellpadding="5" cellspacing="3" width="70%" dir="LTR" frame="hsides" rules="all" summary="This is a JSF code to create dataTable." >i want to first user defined start date and end date of report, type it into the form and later click submit and display report.
I know how to do that not using framework, please tell me how to do that in JSF?
I have main Controller servlet and my Bean is sth like this:
package logic;
import java.util.ArrayList;
import java.util.List;
import javax.naming.*;
import java.sql.*;
import exception.NoConnectionException;
* @author pawel
public class GetDataOracle {
Connection con = null;
Statement ps = null;
ResultSet rs = null;
private List perInfoAll = new ArrayList();
private List rep_dws_wnioski_wstrzymane_cnt = new ArrayList();
private List rep_dws_wnioski_wstrzymane_graph = new ArrayList();
private List rep_tcok_ppi_connects = new ArrayList();
private List rep_tcok_pl_connects = new ArrayList();
private List rep_windyk_hip_umowa_to_call = new ArrayList();
private List rep_tcok_pl2_touchpoint_count = new ArrayList();
private List rep_tcok_pl2_connects = new ArrayList();
public List getperInfoAll() {
    int i = 0;
    try {
    con = Database.createConnection();
    ps =    (Statement) con.createStatement();
    rs = ps.executeQuery("select sso, fname, sname, lev, last_login, login_count from stg123054130.oraclereports_user order by sname");
    while(rs.next()){
      perInfoAll.add(i,new getUsersData(rs.getString(1),rs.getString(2),rs.getString(3),rs.getString(4),rs.getString(5),rs.getString(6)));
      i++;
    } catch (NamingException e) {
        e.printStackTrace();
        throw new NoConnectionException(); 
    } catch (SQLException e) {
        e.printStackTrace();
        throw new NoConnectionException(); 
    } catch (NullPointerException e) {
        e.printStackTrace();
        throw new NoConnectionException();  // obsluga bledy na wypadek jesli braknie wolnych polaczen do bazy
    } finally {
    try {
        if(con != null)
        con.close();
    } catch (SQLException e) {
        e.printStackTrace();
    } catch (NullPointerException e) {
        e.printStackTrace();
        throw new NoConnectionException();  // obsluga bledy na wypadek jesli braknie wolnych polaczen do bazy
return perInfoAll;
public class getUsersData {
String sso;
String fname;
String sname;
String lev;
String last_login;
String login_count;
public getUsersData(String sso, String fname, String sname, String lev, String last_login, String login_count) {
    this.sso = sso;
    this.fname = fname;
    this.sname = sname;
    this.lev = lev;
    this.last_login = last_login;
    this.login_count = login_count;
public String getsso() {
    return sso;
public String getfname() {
    return fname;
public String getsname() {
    return sname;
public String getlev() {
    return lev;
public String getlast_login() {
    return last_login;
public String getlogin_count() {
    return login_count;
}How should i send to my Bean info that i want data where:
select sso, fname, sname, lev, last_login, login_count from stg123054130.oraclereports_user
where last_login > to_date('20091101','YYYYMMDD')
order by sname;
?

Hi 404116,
Here's another method :
1. After you have queried the Block-3 <Subject Block> you have the Student-id from Block-2 which you can use to query the Block-1.
-- I will use the following code to query the Block-1
1. Check the Block Status of Block-1. As you have queried the Block-3 and Not Block-1, the Block Status of Block-1 should not be 'QUERY'.
2. If status of Block-1 is not 'QUERY' And
status of Block-2 is 'QUERY'
Then
/* The query process is reverse from Block-3 first */
2a. Use the Set_Block_Property Built-In to define the Where Condition for the Block-1.
Where column to Query = : Block-2.Student Id
2b. Remove the Relation between Block1 and Block-2 at Run Time.
2c. Go_Block ('Block-1');
Clear_Block (No_Validate);
Execute_Query;
And Remember,
1. To remove the Where Condition set in Block-1 when you query from Block-1 first
2. And re-define the MD relation from Block-1 to Block-2
-- Shailender Mehta --

Similar Messages

  • Slow Query only with some values??????

    I have this tables:
    Vehicles: id_vehicle, id_customer, registration_number, model, ... (2.000.000 of records) (1.500.000 distinct id_customer)
    Insurance-Customers-Vehicles: id_insurance, id_customer, id_vehicle ... (4.500.000 of records)
    Insurance: id_insurance, date_insurance, ...
    Customers: id_customer, name, surname, ..
    QUERY:
    select
    vh.id_vehicle,
    vh.id_customer,
    vd.model,
    vd.registration_number
    from Insurance-Customers-Vehicles vh
    left join Vehicles v on (vh.id_vehicle = v.id_vehicle and vh.id_customer = v.id_customer)
    inner join Vehicles vd on (vh.cod_vehiculo = vd.cod_vehiculo)
    where vh.id_customer = 123456
    and vh.id_vehicle is null
    I execute this query because I want to obtain Vehicles that have been associated with a customer but I don’t want to obtain the vehicle-customer on Insurance-Customers-Vehicles table if it’s now associated to the vehicle-customer on vehicles table.
    This query is very fast at 99% of the time (less than 1 second), but when a client has many vehicles associated (more than 50) on Insurance-Customers-Vehicles table the query is very slow and takes between 10 and 20 seconds ...
    Insurance-Customers-Vehicles
    Please, How can I improve it?????
    Thanks in advance!!!!!
    Operation     Object Name                              Rows     Bytes     Cost     Object Node     In/Out     PStart     PStop
    SELECT STATEMENT Optimizer Mode=CHOOSE                         3             12                                          
      NESTED LOOPS                                        3       498       12                                          
        FILTER                                                                
          NESTED LOOPS OUTER                                                                
            TABLE ACCESS BY INDEX ROWID     Insurance-Customers-Vehicles     3       408       6                                          
              INDEX RANGE SCAN     IND_INSCUVEH_ID_CUSTOMER          3             3                                          
            TABLE ACCESS BY INDEX ROWID     VEHICLES               1       13       2                                          
              INDEX UNIQUE SCAN     PK_VEHICLES                    1             1                                          
        TABLE ACCESS BY INDEX ROWID     VEHICLES                    1       17                                                
          INDEX UNIQUE SCAN     PK_VEHICLES                         1             1                  

    I think there is something logically wrong with this query.
    You left join the vehicle table, however you already know that id_vehicle is NULL.
    I'm not sure what it should achieve, maybe you should replace this join with an EXISTS sub select, maybe you can remove this join completely.
    Try to find an example where your query gives a different result than this one. And explain me why the result is different.
    select vh.id_vehicle,
          vh.id_customer,
          vd.model,
          vd.registration_number
    from Insurance-Customers-Vehicles vh
    inner join Vehicles vd on (vh.cod_vehiculo = vd.cod_vehiculo)
    where vh.id_customer = 123456
    and vh.id_vehicle is null;Message was edited by:
    Sven W.

  • A filter value for Query is set with some value automatically

    Hello SAP sourcing Guru!
    I created a query which has several filters.
    Some of Filter's type is VLV.
    When I preview the query somehow the filter values are already set with some value even though I did not set the default value.
    For example, filter name is Region and there are four regions: Asia, NA, Europe, and SA.
    I want to select one of them from drop-down menu. But Asia was already selected when I clicked the preview button for the query. I want to see "Please Select" instead of Asia from drop-down menu. I did not select "Prefill value from cache" for the filter. I made the filter Optional only. I did not set Default Value either for the filter.
    Any clues?
    Thank you for your response in advance.

    Hi,
    In the Default value field of the filter prompts, you need to mention the Class Reference ID of the corresponding field. E.g., if you have Contract document phase as a filter, then in that if you want to display a blank or none value, then you should use null:2016.
    Similarly for vlv type, the system has a value 616. Hence if you want to display a None value insteead of Asia, use the following in the Default value field:
    0:616:null.
    The way to find the class reference ID is to goto the RG > Class Reference > Look for the field that you are attempting to default on.
    Hope this helps,
    Vikram

  • Able to use % to query data in Some self service pages but in some pages we

    Able to use % to query data in Some self service pages but in some pages we get error " Search string cannot start with % "

    Able to use % to query data in Some self service pages but in some pages we get error " Search string cannot start with % "This is an intended functionality in 11i/R12 (for performance).
    "Please fill in selective criteria in at least one of the following fields for performance reasons" in View Requests Form After ATG RUP7 [ID 1095125.1]
    Re: When clicked Specific Requests
    Re: query mode 11i
    Blind Search
    https://forums.oracle.com/forums/search.jspa?threadID=&q=Blind+AND+Search&objID=c3&dateRange=all&userID=&numResults=15&rankBy=10001
    Blind Query
    https://forums.oracle.com/forums/search.jspa?threadID=&q=Blind+AND+Query&objID=c3&dateRange=thisyear&userID=&numResults=15&rankBy=10001
    Thanks,
    Hussein

  • Blurd,transparent messagebox with some values to be selected

    I have seen many times that if we give any command on web page then a blurd and transparent type messagebox comes on screen with some values in it and screen .
    When we select any value on that messagebox that values goes on next page.
    I dont know how to proceed for such transparent window.
    anybody please help.
    thanks and regards

    Are you sure this has something to do with Java?
    (Javascript.is.not.Java)
    db

  • When we execute   transcation selection-screen should come with some values

    hi gurus,
    My requirement is whenever user executes a particular transaction,
    selection screen should appear with some values by default.
    can you suggest me in solving this problem.
    its urgent.
    thanks,
    Bhanu.R

    Hi,
    for that do like:
    A transaction with a variant can have its own transaction code, which you can then use to execute the transaction with the appropriate variant.
    To create a variant transaction, proceed as follows:
    Choose Goto ® Create vari. trans. from the initial transaction variant maintenance screen.
    Enter a transaction name and corresponding short text. Transaction type Variant transaction is already set. The following screen already contains default values for the name of the calling transaction, the variant name, and the client-specific or cross-client variant checkbox.
    Save your entries.
    Example:
    Variant ABC has been defined for transaction Z000. We now want to create the variant transaction ZVAR.
    Name of the new transaction: ZVAR
    Name of the calling transaction: Z000
    Name of the variant: ABC
    Transaction ZVAR starts transaction Z000 with variant ABC.
    If the variant specified for a variant transaction does not exist (in the current client), then the calling transaction will be started without variant.
    Regards,
    Renjith Michael.

  • Submit a report program with same selection screen with some values exclude

    Dear All,
    I have to  submit a stndard report program from a copied zprogram with same slection screen values ,
    and in some slect-options some values will be excluded depending upon the zprogram.
    How to make it.
    I mean when i submit , same selction screen values should go along with , depending upon some condions i have to exclude some values .
    for ex: selection screen from a to b
    posting date should go same
    but may be along with it i have to pass movem,ent type <> 202 to the submit screen ,.
    how to do this?

    Hi Rajendra
    >What if i have to pass the movement type also 200 to 250 , with 202 and 203 exluded .
    Use BT ( between ) operator for 200 to 250 :
    lr_move_type-sign = 'I'.
    lr_move_type-option = 'BT'.
    lr_move_type-low = '200'.
    lr_move_type-high = '250'.
    COLLECT lr_move_type.
    And use NE ( not equal )  operator to exclude 202 and 203 :
    lr_move_type-sign = 'I'.
    lr_move_type-option = 'NE'.
    lr_move_type-low = '202'.
    COLLECT lr_move_type.
    lr_move_type-low = '203'.
    COLLECT lr_move_type.
    It works just this way.
    > Secondly,
    >
    > If i have the selction sreen same in both the screen , is it possible to pass the same values as it is with out writing one by one selct-option and parameter?
    No I don't think there is way to do it without writing one by one
    but you may not specify for empty select-options.
    Edited by: Bulent Balci on Aug 21, 2010 11:46 AM

  • Collecting same data with different value into a table

    Hi,
    Can you people help me with this problem.
    I have an internal table with different data e.g :
    A    2
    B    1
    C    3
    A    1
    D    7
    B    5
    Now i want to put the values of A,B,C,D into another internal table with some other calculation done.
    But when i am using READ Table with KEY my second internal table is getting filled with A=2 and the second A=2 as well instead of 1.I guess because it is reading the first record only as its finding A first.
    How will i fix this one.
    Kind Regards,

    >
    Prasenjit Sengupta wrote:
    > Hi,
    >
    > Can you people help me with this problem.
    > I have an internal table with different data e.g :
    > A    2
    > B    1
    > C    3
    > A    1
    > D    7
    > B    5
    > Now i want to put the values of A,B,C,D into another internal table with some other calculation done.
    > But when i am using READ Table with KEY my second internal table is getting filled with A=2 and the second A=2 as well instead of 1.I guess because it is reading the first record only as its finding A first.
    > How will i fix this one.
    >
    > Kind Regards,
    Can you tell me the exact requirement of yours?

  • How to compare date with null value

    Hi
    I have a date filed and i assigned that input box with context attribute of type Date.
    Here my problem is
    when the end user not entered any thing (null ) the i have give some defaul date.
    so first in the action method i have to check the date with null
    if it is null i have to give default date.
    so please let me know how to over come this.
    thanks
    Mukesh

    Hi
    You can get your date in your action method like
    Date newDate=new Date();
    Date myDate= wdThis
                              .wdGetYourComponentNameController()
                                      .wdGetContext()
                                           .currentYourNodeNameElement()
                                                           .getYourDateName();
    if ( myDate== null) {
             wdContext.currentContextElement().setYourDateName(newDate);
    else{...........//continue your other validations or calling other methods}
    Regards
    Abhijith YS
    Message was edited by:
            Abhijith YS

  • Sql sript for Insert of data with repeating values

    It has been a long long time since I had to do write and use any SQL scripts, please forgive the question. I used to use a script to insert values into a table as part of my job. I have forgotten what the script I used was and since lost all my Oracle note books and other DBA material.
    I did a search and went through 30 pages of results, I didn't see what I'm looking for.
    The data is from one large file that is appended at the end and sometimes updated somewhere in the middle of the set which is considered new data. I am not concern with getting the data out of the file, I got that handled but the insert into the table - transactions - is where I'm lost.
    I used to use a script to load the data, about 6 years ago, and it would load the file, exclude the data that was already in the table and insert the new data and the data with the changes.
    The data columns are date, time, reference, transaction code, location, debit amount, fee amount, balance.
    The date repeats but the time and reference values are unique.
    Any help with this script is appreciated.

    Hi,
    welcome to the forum..!
    You can use Oracle's merge statement to (update + insert) data into a table ... if the data exists update it with the new values and if it does not, then insert it.
    Here's a link to get you started...
    http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_9016.htm
    Since, the data is from a file, you could create an external table on the file and directly do a select from the file.
    MERGE INTO bonuses D
       USING (SELECT employee_id, salary, department_id FROM employees
       WHERE department_id = 80) S
       ON (D.employee_id = S.employee_id)
       WHEN MATCHED THEN UPDATE SET D.bonus = D.bonus + S.salary*.01
         DELETE WHERE (S.salary > 8000)
       WHEN NOT MATCHED THEN INSERT (D.employee_id, D.bonus)
         VALUES (S.employee_id, S.salary*0.1)
         WHERE (S.salary <= 8000);in the above example, the
    SELECT employee_id, salary, department_id FROM employeesis the source data. instead of loading the file into a temporary table and then merge into the target table , you could read from <<<external_table_on_your_file>> and then do a merge into the target table.
    http://www.oracle.com/technology/products/oracle9i/daily/sept19.html
    If you encounter any problems, please post the full description of your error.
    Thanks,
    Rajesh.
    Please mark this/any other answer as helpful or answered if it is so. If not, provide additional details/feedback.
    Always try to provide create table and insert statements to help the forum members help you better.

  • Calling html from java with some values

    Hello friends,
    I can call a HTML file from java.I want to pass some values from java class file to that html file.Anybody help me how to pass parameters?
    Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler http://localhost:8080/jcoDemo/dp.html");
    is one i am using for calling html file
    thanks

    Just add GET query parameters to the URL.
    Besides, if you were using Java 1.6 or newer, then rather use [Desktop#browse()|http://java.sun.com/javase/6/docs/api/java/awt/Desktop.html#browse(java.net.URI)] instead of Runtime#exec(). It is crossplatform while your runtime approach works in Mircosoft Windows systems only.

  • Ideapad u300 screen not working - covered with some weird displays

    A few days when I turned on my laptop, I could not see the log in box since the screen was mostly covered by some weird displays. I can only see the down right corner of the screen where I can choose to shut down or restart. But I can see the whole screen normally if I connect the laptop with a external screen, like a TV screen with HDMI cable.  Does it mean that the laptop screen is broken and I need to get a replacement?

    Pharaoh wrote:
    Hi there,So I've had my laptop for a while now and the touch screen stopped working a long time ago as well. I figured that I would wait until maybe someone posted a solution somewhere but there hasn't been any posts about it (that I could find) and it's been a really long time so I figured I would ask. So here's the problem. Touch screen stopped working. No idea why. Quite suddenly the touch screen decided to no longer work. I checked the driver and the computer says its functioning properly. I tried to see if there was some kind of update that I should download, and my efforts yet again were in vain. Alas, I figured the more knowledgable might be able to guide me in the right direction so....any ideas? With thanks,MattHave you tried restoring to factory condition through the use of OKR?

  • Inserting a db row from a form with a value passed in from another page

    We have a report (P1) on a table (T1). P1 has a link column (C), and C is the PK on T1. Clicking on a link (i.e., a row) in report P1, takes us to form (P2). P2 is used to allow the user to insert a new row into T1, with the constraint that one of the columns (X) in T1 must have the same value as X had in the linked row on P1. Also, X is a NOT NULL attribute.
    What we are doing is:
    First, passing C to P2 by setting the link name=P2_X_C and the link value=#C#
    Second, in P2, we are setting form element P2_C via a SQL statement:
    SELECT X
    FROM T1
    WHERE C = :P2_X_C
    P2 displays nicely. We set P2_C to display only, and allow the user to enter values for the other columns. The value displayed for X is not NULL and correctly matches the value from P1. However, when we hit the CREATE button on P2, we get error: ORA-01400: cannot insert NULL into "T1"."X". Unable to process row of table T1.
    APEX seems to have an "issue" with having a value in a form "set" and transmitted to the DB on INSERT.
    Any help would be greatly appreciated.

    Hi,
    1 For "Display Only" items that you are not populating directly from a database column, if you want to save the value, you have to ensure that Save Session State is set to Yes and these items are not actually submitted with the page. The same sort of thing would apply to Disabled or Read-Only items as browsers do not submit these items - though these are more tricky to deal.
    2 Passing the PK value is the most common way of identifying which record contains the values you need. Passing other values is also typical - eg, for applying filters for calendars or searches or for setting flags.
    3 For database columns, which should be based on the underlying table's data, you can use the Default Value settings - though be aware that these values do not exist in session state until the page is submitted. That's ok if you don't need to use the value anywhere else on your page
    Andy

  • Need to hide rows in the Query results with blank values

    Hi All,
    We have a requirement like this for Stock Report, we need to display both movements and balance in that report. We display the movement data directly from the Standard cube with input as Fiscal period/year.  When we do like this, we are not able to get the opening balance as fiscal period was in char restrictions pane.
    We have created a dummy keyfigure restricted to Fiscal period ( so that the global filter is not applied and get the inventory data irrespective of fiscal period input ). We have created 3 variables of processing type customer exit and acheived calculating opening balance, current movement and closing balance.
    If FP input is 009.2010 to 010.2010, it will get whatever Qty moved before 009.2010 ( 001.1990 - 009.2010 in exit ) as opening balance and closing balance ( 001.1990 - 010.2010 )  and the Qty KF restricted with another exit varibale ( 009.2010 to 010.2010 ).
    Hope everyone understood the scenario and issue here is, though I give the input 009.2010 - 010.2010 , I get the rows displayed for different periods ( this is because I am retreiving data for all the fiscal periods but restricting it based on input ). How to restrict/hide these rows.
    Your inputs and suggestions are valued.
    Thanks,
    Chandra.

    Hi,
    Try creating a query level field which would populate as "X" (with the IF condition ) if the record falls in the period which you have given for input variable (009.2010 - 010.2010). Then place a query level filter for this field where only records with value "1" for this field is displayed.
    Hope this helps.
    Happy to help further.
    Regards
    Venky

  • ALV with header value display.

    Contract Account     100000000002
    Payment Type:     DDWA-M     DDWA Monthly
    Contract Data
    Contract Number     Division     Start Date     PAA Amount     Currency     Freq.     End Date     Payment Date     Change RSN
    10000011     01     01.12.2008     45     GBP     M     31.12.9999     15.12.2008     
    10000012     01     01.12.2008     40     GBP     M     31.12.9999     15.12.2008     
    10000013     02     01.12.2008     39     GBP     M     31.12.9999     15.12.2008     
         Total     124     
    I need to create an ALV which has the above type of structure wtih some editable fields.
    I am using OOP to do the same. however, how do i display the header part marked in bold along with the ALV without designing the screen accordingly. is there a way in which i can put such headers along with the ALV?

    Hi,
    try using FM REUSE_ALV_COMMENTARY_WRITE and pass the value in IT_LIST_COMMENTARY as Header = 'H'.
    double click on SLIS_T_LISTHEADER and see the spool slis ..
    i hope u will understand the values to be passed to the header area..
    if the issue still persist , pls let me know..
    thanks

Maybe you are looking for

  • How to capture the different sold-to party for a single WBS Element

    Hello, The client wants to automatically populate the Partner field in the WBSE. The Sold-to party that is indicated in the Sales Order will be the same with the Partner Field in the WBSE. I would like to ask regarding on how can we capture the diffe

  • Unusual problem in kernel upgrade in grub UUID

    FWIW ::grub wiki shows a forward slash in the grub line for UUID at the beginning of the UUID data. The grub generated by the new kernel linux-3.0-1 inserts an equals sign.  This user is not aware if all downloads provide this difference. With the eq

  • Result row on the top..

    Hi All In my report the overall result row is displaying at the top of the report.In the result properies the result position is checked as below. I used a hierarchy in this query.Even I checked root/totals appear below in the Hierarchy attributes in

  • Any and All flash players - Will Not Install

    it gets held up at "waiting for last 4 items to install" and wont install it completely, I have restarted, uninstalled, installed. I dont know what else to do? I tried repairing permissions, it repaired quite a few things, but this did not lead to th

  • Copy after to before for multiple photos?

    Frequently I forget to update the 'after' adjustments to the 'before' adjustments for photos I visit. Is there a way to perform 'copy after settings to before settings' for selected photos. It would save me having to manually visit each one by one. M