Selection first n(20 )records from result page
Hi,
I have a requirement where the the users want to select first n(20) record from the result page after applying the date filter . They want to see all results and then select the records say first 50.I do not want to select manually clicking( browsing on page).Any thoughts how this can be achieved like adding text box at frame so that I can give number .
Hello Senthil,
why you want to create one more textbox... you can achieve your requirement by entering 20 in "maximum number of fields". It will give first 20 results.
If you want to add one more textbox for your purpose then tell me.
Thanks and Regards,
Amit Singh
Similar Messages
-
Select first and last records in grouped results - Oracle 11g
Say I have the following information in an Oracle 11g table:
Qty
Production order
Date and time
20
00000000000000001
12-JAN-14 00:02
20
00000000000000001
12-JAN-14 00:05
20
00000000000000001
12-JAN-14 00:07
20
00000000000000001
13-JAN-14 00:09
30
00000000000000002
12-JAN-14 00:11
30
00000000000000002
12-JAN-14 00:15
30
00000000000000002
12-JAN-14 00:20
30
00000000000000002
14-JAN-14 00:29
I would like to write a query that would return the following:
Qty
Production order
First
Last
80
00000000000000001
12-JAN-14 00:02
13-JAN-14 00:09
120
00000000000000002
12-JAN-14 00:11
14-JAN-14 00:29
That is, the sum of the Qty column grouped by Production order, and the date/time of the first and last records for each Production order.
I came up with a query that yielded this result:
Qty
Production order
First
Last
80
00000000000000001
12-JAN-14 00:02
14-JAN-14 00:29
120
00000000000000002
12-JAN-14 00:02
14-JAN-14 00:29
Which means that the First and Last columns show the overall first and last date / time of the whole table. Please note that this is a dummy table. Sorry I am now allowed to write the actual query
I came up with since work policies do not allow me to share it. Also, I tried with windowing functions such as rank()and row_number() but my user does not have enough privileges to do so.
Any help or hints will be greatly appreciated.Due to the fact that Oracle does not record the rows in any particular order, it would be wrong that the "first date" would be the first row processed by the query.
Therefore you would have to supply some other column if you do not want to consider the table as ordered by date.
Also, any analytical functions will need you to supply the "order by" and if its the date, then just a simple query will do:
SQL>WITH Tab1 (Qty, Production_Order, Pdate)
2 AS (SELECT 20, '00000000000000001', TO_DATE ( '12-JAN-14 00:02', 'DD-MON-YY HH24:MI') FROM DUAL UNION ALL
3 SELECT 20, '00000000000000001', TO_DATE ( '12-JAN-14 00:05', 'DD-MON-YY HH24:MI') FROM DUAL UNION ALL
4 SELECT 20, '00000000000000001', TO_DATE ( '12-JAN-14 00:07', 'DD-MON-YY HH24:MI') FROM DUAL UNION ALL
5 SELECT 20, '00000000000000001', TO_DATE ( '13-JAN-14 00:09', 'DD-MON-YY HH24:MI') FROM DUAL UNION ALL
6 SELECT 30, '00000000000000002', TO_DATE ( '12-JAN-14 00:11', 'DD-MON-YY HH24:MI') FROM DUAL UNION ALL
7 SELECT 30, '00000000000000002', TO_DATE ( '12-JAN-14 00:15', 'DD-MON-YY HH24:MI') FROM DUAL UNION ALL
8 SELECT 30, '00000000000000002', TO_DATE ( '12-JAN-14 00:20', 'DD-MON-YY HH24:MI') FROM DUAL UNION ALL
9 SELECT 30, '00000000000000002', TO_DATE ( '14-JAN-14 00:29', 'DD-MON-YY HH24:MI') FROM DUAL)
10 SELECT SUM ( Qty), Production_Order, MIN ( Pdate), MAX ( Pdate)
11 FROM Tab1
12 GROUP BY Production_Order
13* ORDER BY Production_Order
SQL> /
SUM(QTY) PRODUCTION_ORDER MIN(PDATE) MAX(PDATE)
80 00000000000000001 12-Jan-2014 00:02:00 13-Jan-2014 00:09:00
120 00000000000000002 12-Jan-2014 00:11:00 14-Jan-2014 00:29:00 -
Format first and last record of result query
Hello
I have the following query
<tt>select 1 seq, 'This is First record' data from dual union all
select 2, 'Data ' || tname from tab union all
select 3, 'This was last record Last record' from dual
order by 1</tt>
When i spool this statement to a listfile with col seq noprint option i get:
This is First record
Data MLA_ACCESS_LIST
Data MLA_APPLICATIONS
Data MLA_VPD_PCK
Data MLA_VPD_TABLES
This was last record Last record
But i want:
This is First record MLA_ACCESS_LIST
Data MLA_APPLICATIONS
Data MLA_VPD_PCK
MLA_VPD_TABLES This was last record Last record
I tried it with 1 statement with usage of lead and lag, because first and last record have to differ from the other result records. But i get ORA-30484: missing window specification for this function
Is this possible with 1 statement or am i doomed to edit the results by myself?
Thanks Aukeselect case row_number() over (order by tname)
when 1 then 'This is the First record '
end || tname ||
case row_number() over (order by tname desc)
when 1 then ' This was the last record'
end
from tab
order by tname
hth -
Can't select text on a safari search results page
Hi, I'm using an Ipad 3 I have safari sset to use the google search in settings
but when I search for something and it shows the results page I can only select links holding my finger on the text below the link does nothing.
sometimes the answer i'm looking for is in the text and I can just copy it instead of having to click the link to see it.I found out that you gotta do a double tap and hold the only problem is its cumbersome and it only works if safari is set to search google or yahoo if it's set to use bing it does not work at all..
I've added the code below which will unlock the text select feature when selecting text on a search results page
I wrote this java script which allows you to just press and hold on the text to select it.. gets rid of having to double tap and hold and acts like select does on all the other apps. It will also work if your search engine is set to bing.
to use you will need 2 book marks 1 book mark is for google & yahoo the other is for bing
add any book mark then go into it and edit it, in the title type "Unlock Text Selection"
just below the title paste this javascript in
javascript:void(s = 'hdurj123'); s = '(' + s + ')'; x = new RegExp(s, 'gi'); rn = Math.floor(Math.random() * 100); rid = 'z' + rn; b = document.body.innerHTML; b = b.replace(x, '<span name=' + rid + ' id=' + rid + ' style=\'color:#000;background-color:white; font-weight:bold;\'>hdurj123</span>'); void(document.body.innerHTML = b);
then save it under the book marks bar
create a second bookmark and edit it
in the title type "Unlock Selection Bing" and below that past this java script in
javascript:void(s = 'results'); s = '(' + s + ')'; x = new RegExp(s, 'gi'); rn = Math.floor(Math.random() * 100); rid = 'z' + rn; b = document.body.innerHTML; b = b.replace(x, '<span name=' + rid + ' id=' + rid + ' style=\'background-color:white; font-weight:bold;\'>results</span>'); void(document.body.innerHTML = b);
if your search engine is set to yahoo or google:
fire up safari and do a search for something
when the search results show click on the bookmark "Unlock Text Selection"
now you will be able to just press and hold on the text to select it and if you move it around you can select individual words.
if your search engine is set to bing
fire up safari and do a search for something
when the search results show, click on the bookmark "Unlock Selection Bing"
now you will be able to select text with just a press and hold and even individual words
this only works for search results pages I tried it on a page after I clicked the link and it caused safari to display the page source instead of the page.. I just use it for searches
here's an example of setting up the bookmark:
here's what it looks like on a bing search if your search engine is set to bing, in settings:
you can see that I was able to select the individual words, *** if your in portrait you may have to zoom in a bit *** landscape works without having to zoom at all -
I need to fetch the some (1 to 10) records from one page or 50 lines ?
Dear All,
can u tell the query for this ?
cheers,
VenkatYou need to define first 10 rows. How can you say these are first 10 rows. If I define it based on col2 from a table, this would be my query.
select col1
,col2
from (select col1,
col2,
rownum rn
from table
order by col2 desc)
where rn between 10 and 20You can as well use analytics for this based on your requirement.
Cheers
Sarma. -
Af:query : Delete duplicate records from results manually
Hi
I have an ADF page with af:quey on a view object. I have created a viewcriteria to choose few attributes from the view object.
The view object is created manually using a sql query, where the query has joins to various other tables (it has outer joins too).
On submit, due to one to many relationship in the joins, i am getting duplicate rows in the results.
I am currently using 11.1.1.7.0 jDeveloper (We can't upgrade to upper versions due to other constraints of the project). I thought the property 'Selected in Query = false' on the view object attribute would fix this problem (to eliminate duplicate rows). But, i guess, 11.1.1.7.0 don't seem to be supporting this option.
Hence, i was thinking of manually deleting the duplicates from the results of the af:query before displaying it to the user.
Please let me know, if there is a better way to solve the problem, if not, how can i manually remove duplicates from the resultset before displaying the results.
I created a new QueryLIstener method to delete the duplicates, by executing the view object, but it retruns all the records without applying the criteria. May be i am doing something wrong.
Please suggest the best way.
Thanks
PradeepHi Frank,
I do have a distinct in my sql but due to 1->M joins i get duplicate rows. I can avoid it only if i can unselect the attributes in the select.
I like to display the attributes to the user to choose the criteria (which adds as a predicate to the sql). But I would like to unselect the 1-M attributes from the results, so i get distinct rows as i have mentioned distinct in the sql.
Is there a way to restrict duplicate rows ?
Thanks
Pradeep -
How urgent:how can we know the size of a record from result set
hi proffesionals i attend on problum with arrangment,for that what i am doing is i am fetching datas from database and printing in a row vertically.it is not looking good.i want to print it horizontaly like
ae00023 as3333 a6556 a457864 a6576
ae00025 as3336 a6556 a457866 a6578
i wrote the coding like
<%while(resultsetdisplay.next())
{%>
// try to print the datas in horizontal way
<tr>
for (int i=index;i<resultsetdisplay.getFetchSize()-10;i--)
<td class=display><%=resultsetdisplay.getObject(4)%></td>
int i=index;
</tr>
<%}%>
is it prints horizontaly.
help me soonHi
You can the Meta Data for the result set and then get the getColumnCount() from the MataData to get the number of columns in the resultset.
Bye -
Select records across multiple pages
i have a resultset of 100 records. 10 records are displayed and pagination is displayed for the users to navigate to other pages. All this is accomplished using jstl.
if the user selects 2 records on page 1, navigates to page 2 and selects 2 more records, only the records from page 2 get selected. how can the records from page 1 and page 2 get selected? how can i retain selected records between pages?
can anybody please point me to some code snippets?
Thanks,
Jayashree.u have to store some where the index of the selected records..
Shanu -
How to select set of unique data records from internal table
Hi
I am looking for a command in order to select all unique data-records from an internal table without using a loop. Does anybody know a command that could do this?
<b><u>An illustrating example:</u></b>
<i>Example:
Table content
a 1
a 2
a 3
b 1
b 2
c 1
c 2
c 3
d 1</i>
So I am looking for a command that should provide a, b, c & d for the first column or 1, 2 & 3 for the second column<b></b>Hi,
SELECT DISTINCT MATNR
FROM MARA
into table i_mara.
Best regards,
Prashant -
About selecting record from a list
hai sir ,
i have displayed on list using alv function module . but ,i want to select one or more record from the list.
and press any function key it shoud display the records which i was selected.how its possible give some idea.hi,
u can easily do ot using a alv grid control as follows
1.create a class with handle toolbar method by which u can create customized button .Here i have given the function code as DISPLAY.In the handle user commad u have to write the command for displaying the selected row.Using the get selected row methos ,u will get the selected row index so that u can read the internal table with that index to get the record.After getting the selected row u can display it as pop up by calling the function module POPUP_WITH_TABLE_DISPLAY
For enabling the selection in grid ,set the layout like this ls_layout-sel_mode = 'A'.
for pasiing it to set_table_for_first_display
*--->class defenition and implementation
*class defenition
CLASS cl_eventhandler DEFINITION.
PUBLIC SECTION.
METHODS:
handle_toolbar FOR EVENT toolbar OF cl_gui_alv_grid
IMPORTING e_object e_interactive,
handle_user_command FOR EVENT user_command OF cl_gui_alv_grid
IMPORTING e_ucomm,
handle_hotspot_click FOR EVENT hotspot_click OF cl_gui_alv_grid
IMPORTING e_row_id e_column_id es_row_no.
ENDCLASS. "cl_eventhandler DEFINITION
*class implementation
CLASS cl_eventhandler IMPLEMENTATION.
METHOD handle_toolbar.
DATA: ls_toolbar TYPE stb_button.
CLEAR ls_toolbar.
MOVE 'DISPLAY' TO ls_toolbar-function.
MOVE icon_print TO ls_toolbar-icon.
MOVE 'Print warranty sheet' TO ls_toolbar-quickinfo.
MOVE 'Print warranty sheet' TO ls_toolbar-text.
MOVE ' ' TO ls_toolbar-disabled.
APPEND ls_toolbar TO e_object->mt_toolbar.
CLEAR ls_toolbar.
ENDMETHOD. "handle_toolbar
METHOD handle_user_command.
CASE e_ucomm.
WHEN 'DISPLAY'.
CALL METHOD gr1->get_selected_rows
IMPORTING
et_index_rows = lt_rows.
ENDCASE.
ENDMETHOD. "handle_user_command
METHOD handle_hotspot_click .
READ TABLE it_alv INTO wa_alv INDEX e_row_id-index.
IF sy-subrc EQ 0.
CHECK NOT wa_alv-vbeln IS INITIAL.
SET PARAMETER ID '/DBM/ORDER_NUMBER' FIELD wa_alv-vbeln.
CALL TRANSACTION '/DBM/ORDER03' AND SKIP FIRST SCREEN.
ENDIF.
ENDMETHOD. "handle_HOTSPOT_CLICK -
Transfering Table data from one page to another page in OAF
Hi All,
Could you please help me with the following requirement. I am trying to transfer the first page selected records to second page, but running into issue.
I have 2 custom OAF pages:
1st Page is Invoice Search page and upon searching for an invoice, user can select 'multi records' (its table region with multi-select) and click on upload button.
The button internally calls setForwardUrl method and calls 2nd page, where second page contains Advacned Table region to show the selected records from 1st page.
Since user can select more than 1 record in Search region on first page, I would like to hold all rows in an array of Hashmap with Integer index and transfer it to 2nd page. Following is the hashmap syntax I am using:
java.util.HashMap<Integer,InvoiceRow> map=new <Integer,InvoiceRow>(); // Here InvoiceRow is a custom CLASS structure with InvoiceNumber and Customer Number as variables inside.
But if I pass the above HashMap to setForwardURL method, the JDeveloper throwing an exception saying that "setForwardURL cannot invoke" message.
Could you please help me how can I transfer the first page multiselected records to second page?
Appreciate your time.
-- VenkatVenket, the approach i told you can try in below way:
public String getSelectedData()
String whereclause = "(";
// String whereclause1 = "(";
XXCONTAINLINESVOImpl vo = this.getXXCONTAINLINESVO1();
//OAViewObject vo=(OAViewObject)getXXDPECONTAINLINESVO1();
// System.out.println("debTEST"+punload);
Row[] sumVoRow =vo.getFilteredRows("Select1", "Y");
System.out.println("deb multi select test"+sumVoRow.length);
if (sumVoRow != null && sumVoRow.length > 0)
for (int i = 0; i < sumVoRow.length; i++) {
String wipEntityId =
sumVoRow[i].getAttribute("LineId").toString();
whereclause = whereclause+sumVoRow[i].getAttribute("LineId").toString()+",";
System.out.println("deb multi select test"+whereclause);
if (whereclause.length() > 0 && whereclause.charAt(whereclause.length()-1)==',')
StringBuilder b = new StringBuilder(whereclause);
b.replace(whereclause.lastIndexOf(","), whereclause.lastIndexOf(",") + 1, ")" );
whereclause = b.toString();
// return whereclause;
System.out.println("deb where clause test"+whereclause);
return whereclause;
so this method will return the value as like : whereclause=(111,222,333) then put this in one session varibale and pass to the below method from CO
public void processPOData (String wherclause)
String query = getXXDPECONTAINDATAVO1().getQuery();//Old queryStringBuffer stringbuffer = new StringBuffer();
String newwhereclause ="LINE.LINE_ID IN "+wherclause;
System.out.println("DEB NEW where clause:"+newwhereclause);
StringBuffer stringbuffer = new StringBuffer();
// stringbuffer.append("SELECT rownum LINE_NUM,A.* FROM (");
stringbuffer.append(query);
stringbuffer.append(" where ");
stringbuffer.append(newwhereclause);
ViewDefImpl viewdefimpl = getXXDPECONTAINDATAVO1().getViewDefinition();
viewdefimpl.setQuery(stringbuffer.toString());
System.out.println("DEB NEW QUERY TEST:"+stringbuffer.toString());
getXXDPECONTAINDATAVO1().executeQuery();
Let me know if stil r u facing isssue
Thnaks
Deb -
Problem in Retrive values from result set
I have a class where i do all database operation .First i fire select query and take values from result set and based on that value i fire update query.
Problem is that i am not getting all values from result set . i get only last value and when i fire update query i get error as :Resultset is closed.
I am using acess and java.You probably are using the same Statement object for both queries? Try creating separate Statement objects for each query. (My guess is this a problem with the way you're using JDBC, not a Servlet issue.)
-
Choosing a record from a DB to populate a form
This will be my first LiveCycle application. I have an Access 2007 database that contains contact data (first name, last name, etc.). This data will be editable in a PDF of a scanned paper form with databound fields that I've overlaid (that part is already done). I'd like to implement a "Find Contact" dialog that allows for search and selection of a single record from the database, which then gets its details populated into the PDF form. Any suggestions on how to do this?
Thanks,
MarkOkay....now I have a form bound to an Access database with one table called "Contacts". This is just a simple contact database. On my form I have buttons that control navigation (first, last, next, prev, new, save). This works just fine so far.
What I would like to add is a dropdown list or text box where i can pick or search for a contact by last name. This would move the cursor on the recordset to the ID of the first contact found with that last name (i.e. Select TOP 1 ID from Contacts where LastName = ?), or create a new record if one is not found.
Thanks,
Mark -
Update multiple records from a list
Just trying to find some tutorials on how to update multiple
records from 1
page of checkboxes
easiest example is hotmail
i would like to be able to give my clients the ability to
delete or update
multiple records from 1 page... mind you that this type of
update woudl only
be for simple status changes, flags that need to be changed
and so on...
Delete... well if they made it to this page they are already
sure and have
been warned that they are going to delete the records..
where can i find such a tutorial on how to complete multiple
record updates
or deletes from 1 form...
thanksServer model and software below.
And hotmail has nothing to do with anything.. its an example
of what i would
like to be able to do...
If you log into hotmail. you have the option to check all the
emails you
want to delete.
well thats what i want to do with my clients sites...
Each record would have its own checkbox, they select the
records they want
to delete or update and they hit submit to process there
request.
Using ASP, SQL2005 and DW8
"bregent" <[email protected]> wrote in
message
news:f21upb$nop$[email protected]..
> >Just trying to find some tutorials on how to update
multiple records from
> >1
>>page of checkboxes
>
> What server model?
>
>>easiest example is hotmail
>
> What does hotmail have to do with this. -
Webarchive for several levels (clicks) down from main page
Hi there,
I would like to store at least 2 levels of webpages to browse offline, i.e. the main page and the first level of links from that page. I guess I can't do this with Safari. Is there another tool that allows me to do this?
Thanks,
AndreasHi Andreas,
[SiteSucker|http://www.sitesucker.us] might be able to do what you need.
Maybe you are looking for
-
Hi All, I have generated one Smartform. Now i want to print it. but here I want to print smartform in a small size slip. Paper size is 15 cm x 10 cm. How can i do it ? Please tell me the way.. where can i do the settings. I am not be able to find any
-
I receive my bank statements via email. To open the statement, I have to enter a password for the pdf.' I have tried and tried to figure out where I need to enter the password, with no success. I finally gave up, and tried to delete the files I downl
-
Adobe Dreamweaver cc 2014 "software license agreement" poping up before Run :(
Hi Guys ... I set up Adobe Dreamweaver cc on my windows 8.1 every thing is fine after instal but when I want to run it the " software license agreement " displays repeatly after I press "Accept" button I've done most recommend ways in internet that w
-
Is Appleworks 5 for Windows compatible with Windows 7?
Can Appleworks 5 for Windows be installed and run on a Windows 7 PC?
-
SLIN error in sap standrad program
Hello we are using 4.6c version and trying to apply servicepacks through oss notes i found that there is an extended progarm check error in the program SAPLV61A in include RV64A640 there is a statement DATA: wa_/rex/r_sd_icat02 LIKE /rex/r_sd_icat