To display all the records

Am having query like this.
SELECT nvl(TR_ST_LOGINID,(select distinct TR_ST_LOGINID FROM TR_SWAPDAILYTRANS
where 1=1 and tr_st_loginid='C177' )) TR_ST_LOGINID,
nvl(time_in,d), nvl(to_char(tr_st_logintime,'HH24:MI:SS'),'0') tr_st_logintime
FROM
(SELECT TO_DATE('14-FEB-08', 'DD-MON-RR') - 1 + rownum AS d
FROM all_objects
WHERE TO_DATE('14-FEB-08', 'DD-MON-RR') - 1 + rownum <= TO_DATE('29-FEB-08', 'DD-MON-RR')) t,
(SELECT tr_st_loginid TR_ST_LOGINID,
TRUNC(tr_st_logintime ) time_in,
MIN(tr_st_logintime) tr_st_logintime
FROM TR_SWAPDAILYTRANS
WHERE tr_st_loginid='C177'
AND TRUNC(tr_st_logintime) BETWEEN '14-FEB-08' AND '29-FEB-08'
GROUP BY tr_st_loginid, TRUNC(tr_st_logintime ) order by 1) td
WHERE t.d=td.time_in(+)
and 'BEFORE10' IN( 'AFTER10','BEFORE10')
Am running this query for particular employee. If I need to display for all the employees,then How can I modify this?
That is,I need to change the where condition of 'WHERE tr_st_loginid='C177' this.
Actually that query is using for reports10g. So, we have to display for particular employee and also should display for all the employees,if we need.According to the input, it should populate.
Kindly suggest me.
Regards,
Lakshmi.P.
Edited by: [email protected] on Feb 26, 2009 10:40 PM

Query:
SELECT nvl(TR_ST_LOGINID,(select distinct TR_ST_LOGINID FROM TR_SWAPDAILYTRANS
where 1=1 and tr_st_loginid='C177' )) TR_ST_LOGINID,
nvl(time_in,d), nvl(to_char(tr_st_logintime,'HH24:MI:SS'),'0') tr_st_logintime
FROM
(SELECT TO_DATE('14-FEB-08', 'DD-MON-RR') - 1 + rownum AS d
FROM all_objects
WHERE TO_DATE('14-FEB-08', 'DD-MON-RR') - 1 + rownum <= TO_DATE('18-FEB-08', 'DD-MON-RR')) t,
(SELECT tr_st_loginid TR_ST_LOGINID,
TRUNC(tr_st_logintime ) time_in,
MIN(tr_st_logintime) tr_st_logintime
FROM TR_SWAPDAILYTRANS
WHERE tr_st_loginid='C177'
AND TRUNC(tr_st_logintime) BETWEEN '14-FEB-08' AND '18-FEB-08'
GROUP BY tr_st_loginid, TRUNC(tr_st_logintime ) order by 1) td
WHERE t.d=td.time_in(+)
and 'BEFORE10' IN( 'AFTER10','BEFORE10')
output:
TR_ST NVL(TI NVL(TO
C177 14-FEB-08 09:21:09
C177 15-FEB-08 09:23:14
C177 16-FEB-08 0
C177 17-FEB-08 0
C177 18-FEB-08 0
In oracle reports, we have this query for one data model like the following
SELECT nvl(TR_ST_LOGINID,(select distinct TR_ST_LOGINID FROM TR_SWAPDAILYTRANS
where 1=1 &EMPNO )) TR_ST_LOGINID,
nvl(time_in,d), nvl(to_char(tr_st_logintime,'HH24:MI:SS'),'0') tr_st_logintime
FROM
(SELECT TO_DATE(:P_FROM_DATE, 'DD-MON-RR') - 1 + rownum AS d
FROM all_objects
WHERE TO_DATE(:P_FROM_DATE, 'DD-MON-RR') - 1 + rownum <= TO_DATE(:P_to_DATE, 'DD-MON-RR')) t,
(SELECT tr_st_loginid TR_ST_LOGINID,
TRUNC(tr_st_logintime ) time_in,
MIN(tr_st_logintime) tr_st_logintime
FROM TR_SWAPDAILYTRANS
WHERE TRUNC(tr_st_logintime) BETWEEN :P_FROM_DATE AND :P_to_DATE
&EMPNO
&INTIME
GROUP BY tr_st_loginid, TRUNC(tr_st_logintime ) order by 1) td
WHERE t.d=td.time_in(+)
and :P_REPORT_TYPE IN( 'AFTER10','BEFORE10')
In after parameter form,we have
IF :P_EMPNO IS NOT NULL and :P_FULL_LIST = 'N' THEN
          :EMPNO := 'AND tr_st_loginid = :P_EMPNO';
     ELSE
          IF :P_FULL_LIST = 'Y' THEN
               :EMPNO := 'AND tr_st_loginid is not null';
          END IF;
     END IF;
But nvl for first field(i.e.tr_st_loginid) doesn't work. Am new to the reports.So,kindly suggest me how to pass this
&EMPNO to the reports.Because,if we give particular employee as input, then it should display for particular employee only.Suppose, if we will not give any input for employee field,then it should display for all the employees.
Kindly suggest me on this.

Similar Messages

  • Displaying all the records in a tabular form on a single page

    Hello,
    After setting up a data entry page, I have hit an unexpected problem.
    The logic in my page requires that all the records in my tabular form should be displayed .
    The tabular form is based on a collection, and the user selects rows through a checkbox.
    Any reload of the page due to pagination will break the logic, as some calculation and display events occur during page load,
    based on the previous page.
    I need to display about 25 rows.
    I have changed the report attribute to display 50 rows, but it displays rows only up to the bottom of the screen,
    i.e. 11 rows.
    Unfortunately I only just added some new rows and saw this behaviour else I would not have gone that way,
    as I expected APEX to display all rows if required.
    Some help will be much appreciated.
    Regards
    Leckraj

    leckj wrote:
    Hello,
    After setting up a data entry page, I have hit an unexpected problem.
    The logic in my page requires that all the records in my tabular form should be displayed .
    The tabular form is based on a collection, and the user selects rows through a checkbox.
    Any reload of the page due to pagination will break the logic, as some calculation and display events occur during page load,
    based on the previous page.
    I need to display about 25 rows.
    I have changed the report attribute to display 50 rows, but it displays rows only up to the bottom of the screen,
    i.e. 11 rows.
    Unfortunately I only just added some new rows and saw this behaviour else I would not have gone that way,
    as I expected APEX to display all rows if required.Pagination settings are cached for the duration of the session. For this change to be instantly visible, either log out, restart the brower, and log in again, or manually re-request the page from the browser address bar, adding 'RP' in the ClearCache position in the URL.

  • How to display all the Records of all the "Books of Business" in Report ?

    Hello,
    I have a user with 3 "Books of Business" (No Sub Books).
    I would like to generate a report with the data of the 3 books.
    With the "selector", it seems that I can't choose the "All" option.
    Can someone confirm the behavior ?
    Thanks for your help.

    Hello,
    I do have a similar problem.
    I have already tried to create a parent book (the checkbox "can contain data" is not activated), assign it to sub-books and add first my user as a book user (Admin role). However, when I start a simple report which should show e.g. Number of Contacts in a book an choose the parent book in the book selector I get an error message and there are no results ("The specified criteria didn't result in any data").
    Did I miss any setup steps or is not possible to see all the records at once which belong to the sub-books with a parent book?
    If I pick my user book, I see only the records I own. The problem is that our CEO needs a view there he could see records in sub-books separately but also the records in both of them at once. Unfortunately, the Manager Visibility can not be applied because we have a different hierarchy in the system as it is in real (otherwise wrong data in forecasts).
    Many thanks in advance
    Regards, Vilma

  • How to display All the rows in a Table

    Hi All,
    Our requirement is, we need to display all the records of an VO in a table. We should not have navigation bar with previous and next. Runtime only will come to know how many records the VO has. Is it possible to achieve our requirement using setNumberOfRowsDisplayed() method in OATableBean ?

    Do u want to do it declaratively or programmatically.
    Declaratively You can set no of rows property of table bean. If u want to set it programmatically then u can do it as discussed in the thread..
    Regards,
    Ram

  • Report to display all the contacts of an opportunity.

    Hello,
    I have a requirement, can we create a report which displays all the contacts of an opportunity apart from primary contact.
    Any inputs on the same will be appreciatable. TIA
    Edited by: 1004233 on May 6, 2013 12:16 AM
    Edited by: 1004233 on May 6, 2013 3:28 AM
    Edited by: 1004233 on May 6, 2013 3:28 AM

    Hey Aveek;
       Try this, which will get the most recent one.  You would just need to change it to loop at the edids records to get at them all...
          TABLES: *edidc, *edids, *t100.
          DATA: wf_string type string.
          CLEAR *edids.
          SELECT SINGLE *
             INTO *edids
             FROM edids
             WHERE docnum = *edidc-docnum
               AND status = '51'.
          SELECT SINGLE text
             INTO *t100-text
             FROM t100
             WHERE sprsl = 'EN'
               AND arbgb = *edids-stamid
               AND msgnr = *edids-stamno.
             CLEAR wf_string.
          MOVE *edids-stapa1 TO wf_string.
          REPLACE '&' WITH wf_string INTO *t100-text.
          IF sy-subrc EQ 0.
            CLEAR wf_string.
            MOVE *edids-stapa2 TO wf_string.
            REPLACE '&' WITH wf_string INTO *t100-text.
            IF sy-subrc EQ 0.
              CLEAR wf_string.
              MOVE *edids-stapa3 TO wf_string.
              REPLACE '&' WITH wf_string INTO *t100-text.
              IF sy-subrc EQ 0.
                CLEAR wf_string.
                MOVE *edids-stapa4 TO wf_string.
                REPLACE '&' WITH wf_string INTO *t100-text.
              ENDIF.
            ENDIF.
          ENDIF.
          A little sloppy (OK, alot!), but it gets the job done...
    Cheers,
    John

  • Cannot display all the tables of the schema!!!

    Hi:
    I use the oracle sql developer on the windows xp, I found that the tables tab cannot display all the tables of the schema owner, I use the sql "select count(*) from user_tables" I found the result is more than the tab can be display, and I also press the "show more" already.... does anyone can help me ???

    Similarly, I have 852 tables owned by the connected user (selected count from user_tables and checked the user tables report which has this many records returned), but when I double-click on the "Show More" and select Show All, I only get approximately 375 tables listed.
    It doesn't help that the sorting is different - ie ASF_ comes before ASFB in the connection pane but the other way around in the report.
    However, it looks as though the problem is that tables that are not analysed (based on the report data in DATE_LAST_ANALYZED) are not being displayed under the Table node.

  • How to display all incorrect records in PSA

    Hello,
    Is there a shortcut to display all the incorrect records in PSA. I am aware of a particular value that has been posted incorrectly and we're pulling over a million records from R/3. Each time i run the update, it fails due to the same data value error. This is prod env and i'm running delta init after a transfer rule change.
    Pls. help.
    Malli

    Hi malli
    I was facing the same problem. But i just asked my end user to make the changes in his data entry so that there were no errors while extraction itself.
    One more thing what you can do if u know the exact data error is to write one select statement on the PSA table where the condition is the error what ur facing daily. There are no other shortcuts to see a error record in PSA unless untill u face problem while updating the data target. in that case the record in PSA will be in in status red and you can filter for this record.
    Hope i made certain things clear. Please post if u r not convinced.
    Regards
    Sriram

  • BDC(to display all the errors)

    Hi Experts,
    I am uploading data from flat file to sap application by using bdc call transaction method. My flat file is in Txet format.
    Now i want to display all the errors which are nor processed.
    The error report should be line no.of error record,error message and the records which are uploading.
    i am using bdcmsgcoll structure.but it is not having the fields which are required for me. will suggest me with coding how to do it.
    Thanks in advance,
    Mythily

    Hi,
    By using function module  FORMAT_MESSAGE
    Here is a sample code:
    LOOP AT t_message INTO fs_bdcmsgcoll.(T_message is a type of bdcmsgcoll)
        CALL FUNCTION 'FORMAT_MESSAGE'
          EXPORTING
            id        = fs_bdcmsgcoll-msgid
            lang      = sy-langu
            no        = fs_bdcmsgcoll-msgnr
            v1        = fs_bdcmsgcoll-msgv1
            v2        = fs_bdcmsgcoll-msgv2
            v3        = fs_bdcmsgcoll-msgv3
            v4        = fs_bdcmsgcoll-msgv4
          IMPORTING
            msg       = w_message
          EXCEPTIONS
            not_found = 1
            OTHERS    = 2.
        IF sy-subrc <> 0.
          MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                  WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ELSE.
          WRITE:/   w_message.
    endif.
    endloop.
    Hope this solves the issue, let me know if any queries.
    Regards,
    Rajani

  • Reading all the records

    Hi sir,
    I developed one review page using jsp techonology, and with the help of servlet i get connected to the database, where i wrote code for both inserting the record and selecting the record at a time, but problem is only one record is displayed in the review jsp page. Though i used "while(rs.next())".
    1. I think first of all , all the records should be stored to an object, then it should be displayed to jsp page.
    but how it can be done, plz help me out. its an urgent, i need to complete this application soon.
    regards

    problem is only one record is displayed in the review jsp page. Though i used "while(rs.next())".How many records were retrieved in the 'while (rs.next())' loop?
    plz help me out. its an urgent, i need to complete this application soon.Your time management problems are your own. If you need urgent help, hire it. This is a user to user forum, nobody gets priority.

  • Vertical scrollbar not showing all the records when I scroll down.

    Vertical scrollbar not showing all the records when I scroll down.
    Using Oracle forms 10g , operating system windows
    I have two fields with number of items dispayed = 15.
    I have a vertical scroll bar with them. There are 34 records in the table but the scrollbar only shows 15 records.
    Here are the properties for block / scrollbar.
    WORK_CATEGORY
    - Subclass Information                           
    - Comments                                       
    * Navigation Style                                Same Record
    - Previous Navigation Data Block                 
    - Next Navigation Data Block                     
    - Current Record Visual Attribute Group          
    - Query Array Size                                0
    - Number of Records Buffered                      0
    * Number of Records Displayed                     60
    * Query All Records                               No
    - Record Orientation                              Vertical
    * Single Record                                   No
    - Database Data Block                             Yes
    - Enforce Primary Key                             No
    - Query Allowed                                   Yes
    - Query Data Source Type                          Table
    * Query Data Source Name                          WORK_CATEGORY
    * Query Data Source Columns                      
    * Column Name                                   JOB_TYPE
    * Column Type                                   VARCHAR2
    - Column Type Name                             
    - Parent Column                                
    * Length                                        30
    * Precision                                     0
    * Scale                                         0
    * Mandatory                                     Yes
    * Column Name                                   WORK_CATEGORY
    * Column Type                                   VARCHAR2
    - Column Type Name                             
    - Parent Column                                
    * Length                                        30
    * Precision                                     0
    * Scale                                         0
    * Mandatory                                     Yes
    - Query Data Source Arguments                    
    - Alias                                          
    - Include REF Item                                No
    * WHERE Clause                                   
    * ORDER BY Clause                                 job_type
    - Optimizer Hint                                 
    - Insert Allowed                                  Yes
    - Update Allowed                                  Yes
    - Locking Mode                                    Automatic
    - Delete Allowed                                  Yes
    - Key Mode                                        Automatic
    - Update Changed Columns Only                     No
    - Enforce Column Security                         No
    - Maximum Query Time                              0
    * Maximum Records Fetched                         0
    - DML Data Target Type                            Table
    - DML Data Target Name                           
    - Insert Procedure Name                          
    - Insert Procedure Result Set Columns            
    - Insert Procedure Arguments                     
    - Update Procedure Name                          
    - Update Procedure Result Set Columns            
    - Update Procedure Arguments                     
       Don't know where am I going wrong. I'll really appreciate if you can help me in this.
    Thanks.
    Edited by: 831050 on Sep 14, 2011 8:05 AM

    One of the items is a list item.. here are it's properties:
    * Name                                          JOB_TYPE
    * Item Type                                     List Item
    - Subclass Information                         
    - Comments                                     
    - Help Book Topic                              
    - Enabled                                       Yes
    * Elements in List                             
    * Label                                      
    * List Item Value                             LIST20
    * List Style                                    Combo Box
    - Mapping of Other Values                      
    - Implementation Class                         
    - Case Restriction                              Mixed
    - Popup Menu                                   
    - Keyboard Navigable                            Yes
    - Mouse Navigate                                Yes
    - Previous Navigation Item                     
    - Next Navigation Item                         
    - Data Type                                     Char
    - Data Length Semantics                         Null
    - Maximum Length                                30
    - Initial Value                                
    * Required                                      Yes
    * Copy Value from Item                         
    - Synchronize with Item                        
    - Calculation Mode                              None
    - Formula                                      
    - Summary Function                              None
    - Summarized Block                             
    - Summarized Item                              
    - Current Record Visual Attribute Group        
    - Distance Between Records                      0
    * Number of Items Displayed                     15
    - Database Item                                 Yes
    * Column Name                                   JOB_TYPE
    - Primary Key                                   No
    - Query Only                                    No
    - Query Allowed                                 Yes
    - Insert Allowed                                Yes
    - Update Allowed                                Yes
    - Update Only if NULL                           No
    - Visible                                       Yes
    * Canvas                                        CANVAS2
    - Tab Page                                     
    * X Position                                    47
    * Y Position                                    137
    * Width                                         187
    * Height                                        18
    - Visual Attribute Group                        DEFAULT
    - Prompt Visual Attribute Group                 DEFAULT
    - Foreground Color                             
    * Background Color                              white
    - Fill Pattern                                 
    - Font                                         
    * Font Name                                     Tahoma
    * Font Size                                     10
    * Font Weight                                   Demilight
    * Font Style                                    Plain
    * Font Spacing                                  Normal
    * Prompt                                        Job Type
    - Prompt Display Style                          First Record
    * Prompt Justification                          Start
    * Prompt Attachment Edge                        Top
    - Prompt Alignment                              Start
    * Prompt Attachment Offset                      10
    * Prompt Alignment Offset                       0
    - Prompt Reading Order                          Default
    - Prompt Foreground Color                      
    - Prompt Font                                  
    * Prompt Font Name                              Tahoma
    * Prompt Font Size                              10
    * Prompt Font Weight                            Bold
    * Prompt Font Style                             Plain
    * Prompt Font Spacing                           Normal
    - Hint                                         
    - Display Hint Automatically                    No
    - Tooltip                                      
    - Tooltip Visual Attribute Group               
    - Direction                                     Default
    - Initial Keyboard State                        Default
    - Keyboard State                                Any
        

  • How to insert all the records using below loop

    I am iterating value from hash map and store the values in database.
    Below loop structure, the values from hashmap are inserted fine.
    But inside while(rs.next()),first record from db only inserted for all the records
    while(itr.next()){
    Integer key=(Integer)iterator.next();
    String Value=(String) orderNumberMap.get(key);
    while(rs.next()){
    String firstName=rs.getString("fname");
    String lastName=rs.getString("lname");
    insert into tbl values('"+key+"','"+Value+"','"+fname+"','"+lname+"');
    Regards

    Thanks for ur reply. The below is a scenario
    I am having 3 records in a resultset
    firstname= shadik
    lastname frank
    firstname= felix
    lastname sha
    firstname= williams
    lastname= scoot
    To insert above records with key, values retrieved from hashmap as follows
    Number 1
    empid 101
    Number 2
    empid 102
    Number 3
    empid 103
    I need to insert above values in a table and expect a output as follows..
    Number empid firstname lastname
    1 101 shadik frank
    2 102 felix sha
    3 103 williams scoot.
    But output will be displayed as follows
    Number empid firstname lastname
    1 101 shadik frank
    2 102 shadik frank
    3 103 shadik frank.
    Values from HashMap are inserted fine. But retriving from resultset shows only first records for all the rows.

  • Checkbox taking all the records irrespective of selection

    HI All,
    This is my code
    for i in 1..htmldb_application.g_f02.count
    loop
    insert into nam values(htmldb_application.g_f02(i));
    end loop;
    Here i'm trying to insert the selected things but its taking all the records whatever is displaying in the report
    Kindly help me to get rid of the issue
    And guide me how cai insert only checked in records

    hi
    I'm not a pro but maybe I can share some experience.
    First I would create a textfield for debugging.
    This helps to find out what data you are really working with.
    My textfield's name is "PX_SELECTED_ITEMS"
    I filled the textbox with a process in "On submit - After Computations and Validations"
    BEGIN 
      :PX_SELECTED_ITEMS :=
        HTMLDB_UTIL.TABLE_TO_STRING(HTMLDB_APPLICATION.G_F01);
    END;I'm not sure how your values are seperated.
    In my application I hat to replace the seperator from ':' to ','
    Therefore I created another textfield "PX_SELECTED_ITEMS_replaced"
    and added following code to the process:
    :PX_SELECTED_ITEMS_replaced := replace(:PX_SELECTED_ITEMS,':',',');Now I have two textfields wich should contain your selection.
    The second one ("PX_SELECTED_ITEMS_replaced") with the comma seperated data should be good for a "where-filter" in an SQL statement.
    Here is the PL-SQL-syntax I used for a standard SQL report:
    declare
      v_sql varchar2(32767);
    begin
      v_sql := 'select * from  my_table';
      if :PX_SELECTED_ITEMS_replaced is not null then
        v_sql := v_sql ||' where My_ID in ('||:PX_SELECTED_ITEMS_replaced||')';
      else
        v_sql := v_sql ||' where 1=0';
      end if;
      return v_sql;
    end;This Report should contain your selected items.
    Note: This does NOT work with Interacive Reports.
    I hope this helps you finding the issue.
    Edited by: pAT on Nov 26, 2010 4:45 AM

  • How can i display all the query items to a table?

    how can i display all the query items to a table in a jsp file?
    i always have an out of memory error..

    any body??any idea?
    is it possible thru configuration or i have to write a program by the abaper??
    Biswa

  • How can I display all the columns on the screen without scrolling from side to side?

    My clinic software has many columns. How can I display all the columns without having to scroll from left to right all the time?

    If the software you are using doesn't offer the ability to increase or decrease document size, as many do, then the only way is to increase your screen resolution. If that's not possible, maybe you can decrease your font size?  If you can't do any of these, I think you're out of luck!

  • How can I get my iPod touch to display all the artwork on my computer?

    Hi,
    I have an iPod touch 4th gen 32 GB with iOS 6.1 on it.  I have trouble getting it to display all the album artwork that I have on my computer.  Not all of my music has it, but about 90% of it does.  Is there any way I can make it display everything that's on my computer?  I have iTunes 11 on it and it is a Windows 7 computer.  Thanks!

    First, try a system reset.  It cures many ills and it's quick, easy and harmless...
    Hold down the on/off switch and the Home button simultaneously until the screen blacks out or you see the Apple logo.  Ignore the "Slide to power off" text if it appears.  You will not lose any apps, data, music, movies, settings, etc.
    If the Reset doesn't work, try a Restore.  Note that it's nowhere near as quick as a Reset.  Connect via cable to the computer that you use for sync.  From iTunes, select the iPad/iPod and then select the Summary tab.  Follow directions for Restore and be sure to say "yes" to the backup.  You will be warned that all data (apps, music, movies, etc.) will be erased but, as the Restore finishes, you will be asked if you wish the contents of the backup to be copied to the iPad/iPod.  Again, say "yes."
    At the end of the basic Restore, you will be asked if you wish to sync the iPad/iPod.  As before, say "yes."  Note that that sync selection will disappear and the Restore will end if you do not respond within a reasonable time.  If that happens, only the apps that are part of the IOS will appear on your device.  Corrective action is simple -  choose manual "Sync" from the bottom right of iTunes.
    If you're unable to do the Restore, go into Recovery Mode per the instructions here.

Maybe you are looking for