Selecting the rows of the Table !
Dear DBA's
Suppose there is a table in oracle which has 5 records. How will you display 10 records in that table? Is there any crazy way like that, will that be possible ?
Don't know what you want to achieve but here is way to do this:
SQL> select * from test;
NO
1
2
3
4
5
SQL> select * from test union all select * from test;
NO
1
2
3
4
5
1
2
3
4
5
10 rows selected.
Daljit Singh
Similar Messages
-
Select discontiguous rows in a table with the keyboard
I am using jdk 1.3.1 and have tried this on 1.4 as well. I don't seem to be able to select discontiguous rows in a table using the keyboard. I can Ctrl-click with the mouse to do this but can't find a way to do this with the keyboard. I searched and found somebody asked this same question before and the reply was it works in 1.3.1. I am not seeing this. What could I be missing? The Ctrl-Up and Ctrl-Down keys don't do anything and neither does the spacebar.
I'm pretty sure you can't do this using the standard JTable interface.
You might be able to write your own keyboard listener and fake focus events for up&down arrow, but making this work seamlessly with JTable seemss like it would not be trivial. -
Select the table based on 2 months ? Query no working
I have a table TEST1 in schema MESSAGE_REPORT. What i want to do is select the table based on 2 months ( JULY and AUGUST ). The requirement is Whole JULY data should be there and for AUG the data should be till 01 aug . Below is the query i m using but its giving me error . Moreover the Where clause "TRUNC(HIRE,'MONTH') " part is compulsary to be used ,changes have to be made in the ">= timestamp '2010-07-01 00:00:00' and frd.sent_timestamp < timestamp '2010-08-10 00:00:00';" part only . please can anyone help me out
NAME HIRE
SALE 01.07.2010 00:00:00,000000000
cops 15.07.2010 00:00:00,000000000
NAVEED 31.07.2010 00:00:00,000000000
HEN 01.08.2010 00:00:00,000000000
BEN 10.08.2010 00:00:00,000000000
CROSS 15.08.2010 00:00:00,000000000
select * from MESSAGE_REPORT.test1 where
TRUNC(HIRE,'MONTH') >= timestamp '2010-07-01 00:00:00' and frd.sent_timestamp < timestamp '2010-08-10 00:00:00';
ERROR:
ORA-00904: "FRD"."SENT_TIMESTAMP": invalid identifier
00904. 00000 - "%s: invalid identifier"
*Cause:
*Action:
Error at Line: 24 Column: 60Edited by: user12633486 on Aug 11, 2010 1:13 PM
Edited by: user12633486 on Aug 11, 2010 1:51 PMThats becuase you are comparing with Month and not the complete date.
Check this:
SQL> ed
Wrote file afiedt.buf
1 with t as (select 'SALE' col1,'01.07.2010 00:00:00' col2 from dual
2 union all select 'cops','15.07.2010 00:00:00' from dual
3 union all select 'NAVEED','31.07.2010 00:00:00' from dual
4 union all select 'HEN','01.08.2010 00:00:00' from dual
5 union all select 'BEN','10.08.2010 00:00:00' from dual
6 union all select 'CROSS','15.08.2010 00:00:00' from dual)
7 select * from t
8 where
9 TO_DATE(col2,'DD.MM.RRRR HH24:MI:SS') >= timestamp '2010-07-01 00:00:00'
10* and TO_DATE(col2,'DD.MM.RRRR HH24:MI:SS') < timestamp '2010-08-10 00:00:00'
SQL> /
COL1 COL2
SALE 01.07.2010 00:00:00
cops 15.07.2010 00:00:00
NAVEED 31.07.2010 00:00:00
HEN 01.08.2010 00:00:00
SQL>
-- For less than equal to
SQL> ed
Wrote file afiedt.buf
1 with t as (select 'SALE' col1,'01.07.2010 00:00:00' col2 from dual
2 union all select 'cops','15.07.2010 00:00:00' from dual
3 union all select 'NAVEED','31.07.2010 00:00:00' from dual
4 union all select 'HEN','01.08.2010 00:00:00' from dual
5 union all select 'BEN','10.08.2010 00:00:00' from dual
6 union all select 'CROSS','15.08.2010 00:00:00' from dual)
7 select * from t
8 where
9 TO_DATE(col2,'DD.MM.RRRR HH24:MI:SS') >= timestamp '2010-07-01 00:00:00'
10* and TO_DATE(col2,'DD.MM.RRRR HH24:MI:SS') <= timestamp '2010-08-10 00:00:00' -- less than equal to includes data for 10th august as well
SQL> /
COL1 COL2
SALE 01.07.2010 00:00:00
cops 15.07.2010 00:00:00
NAVEED 31.07.2010 00:00:00
HEN 01.08.2010 00:00:00
BEN 10.08.2010 00:00:00
SQL> Edited by: AP on Aug 11, 2010 1:31 AM
Edited by: AP on Aug 11, 2010 1:32 AM -
Selecting multiple rows in a table
Hi All,
I have one problem with selecting multiple rows in a table.I tried with setting table property-selectionMode as Multi, but i dinn't get the solution.
please provide me solution for this.
Thanks & Regards,
Sreelakshmi.HI
Int leadSelection = wdcontext.nodemodelnode.getLeadSelection();
for(int i=0;i<wdcontext.nodeModelNode.size;i++)
if(wdcontext.nodeModelNode.isMultiselected(i) || leadSelection ==i)
String name = wdcontext.nodemodelnode.getnameelementatindex(i).getName();
String address = wdcontext.nodemodelnode.getaddresselementatindex(i).getAddress();
String age = wdcontext.nodemodelnode.getAgeelementatindex(i).getAge();
Create a method for the Table Property onLeadSelect() where you can open a popup window
Create a value node and with attributes same as Table attributes and then set the values of the table
to the value node attributes.
Thanks -
Dynamic Select of Row in a table in webdynpro Abap
Hi,
I have an requirement, I have an table and a button, I need to select a row in a table based on button action.
For example : in a table i have 3 rows. I am submiting a value in a button, I want to see that row highlighted for the value I am sending through button.
Please let us know the code how to implement this.
ThanksHi,
First you have to go to table and set its property "SELECTION MODE" to single or multi lead depending on ur need.
Then in the ACTION of the button you can use the following code to get the values in the selected row.
DATA:
node to get table node for finding no. of rows
lo_nd_one TYPE REF TO if_wd_context_node,
Get selected row for finding no. of rows
it_table TYPE wdr_context_element_set,
workarea to get selected row
wa_table LIKE LINE OF it_table,
To get the Selected line item into an internal table
CALL METHOD lo_nd_one->get_selected_elements
RECEIVING
set = it_table. " data in internal format
IF it_table[] IS NOT INITIAL.
type conversion for work area
READ TABLE it_table INTO wa_table INDEX 1.
if a row is present
IF sy-subrc IS INITIAL.
Get the values of each attribute
CALL METHOD wa_table->get_static_attributes
IMPORTING
static_attributes = wa_final. "<Selected data in work area.> ---> this will have your data
ENDIF.
Here wa_final is the work area which is of your table fields type.
This wa_final will have the selected row. -
Select all rows in af:table
Hi,
I need to select all rows in af:table, not only on current page.
I have following code on custom select all action:
getTable2().getSelectionState().addAll()and on button that needs to perform some action on selected rows I have this code
Set selectedRowSet = getTable2().getSelectionState().getKeySet();
if (!selectedRowSet.isEmpty()) {
Iterator it = selectedRowSet.iterator();
while(it.hasNext()) {
Key key = (Key)it.next();
}selectedRowSet.iterator() method throws java.lang.ClassCastException: oracle.jbo.Key.
When I select rows with af:tableSelectMany, which is inside selection facet and selects only rows on current page, this works fine.
Any ideas?
ThanksHi,
you can only access those data that is queried and part of the CollectionModel to the time you select all
RichTable _table = employeesBackingBean.getEmployeeTable1();
RowKeySet rks = new RowKeySetImpl();
CollectionModel model = (CollectionModel)_table.getValue();
int rowCount = model.getRowCount();
for (int i = 0; i < rowCount; i++) {
model.setRowIndex(i);
//note that in the simple POJO case, the row key is the same
//as the index. However, it would be wrong to just rely on this
//because other models or custom table models my return a more
//comples key. Therefore we iterate over the available rows to
//obtain the keys.
Object key = model.getRowKey();
//add the row keys to the RowKeySet to mark selected
rks.add(key);
_table.setSelectedRowKeys(rks);
AdfFacesContext.getCurrentInstance().addPartialTarget(_table);Frank
Frank -
Select a row from a table and throw an url
Hi experts,
I'm trying to select a row from a table in Visual Composer. What I need to do it's to click over this row and throw an Url. At the moment, I've added a column with a Pushbutton with the formula to show the link; it works fine. But I need to do it without buttons just selecting the row.
Is there anyboby who knows about that?
Thanks a lot.
BelenHi
To do this you will have to use a data store and a guard condition on the line which is triggered by the select action. You need to store a value in the data store each time a select action is performed. The guard condition should check for this and only perform the action when the value in the data store is greater than 0.
Jarrod Williams -
Select multiple rows from dual table
Is it possible to select multiple rows from dual table using a single select statement.
i.e., i want the out put to be
column_name
1
2
3
4
Edited by: vidya.ramachandra on Dec 14, 2009 8:24 AMAside from the fact you're responding to an old thread...
1002424 wrote:
While using CONNECT BY, I see it always leave behind one row.
Suppose I have a condition based on which I have to generate constant rows like
SELECT 1 FROM DUAL WHERE ROWNUM < N;
Here if N = 0, still it gives out single row.... you are obviously doing something wrong in your code elsewhere, because that SQL statement does not always return a single row...
SQL> SELECT 1 FROM DUAL WHERE ROWNUM < 0;
no rows selected
SQL> -
Selecting multiple rows of a table
Hi Forum,
How to select multiple rows of a table at a time? Please help me..
Thanks
SwapnaHi Swapna,
To select more then one row in table, just set the selectionmode property of table to 'multi' or 'auto' and also change the selection property of the node (to which table is binded) to 0:n.
I hope it helps.
Regards
Arjun
Edited by: Arjun on Feb 4, 2009 11:52 AM -
Unable to select any row(s) in table/ALV
Hi ,
I am having a problem while selecting a row in a table/ALV.
I am displaying data in a table which is NOT set to 'Initialize lead selection' in the context.When it is displayed and I try to select a row the row does not get selected(highlighted) in the view.
However,I am able to perform tasks on 'Onselect' event on the rows.Just that its not getting highlighted neither in table nor in ALV.
What could be the reason for this ? I do not want the context element to be set as 'Initialize lead selection' as that would highlight the first line of the table when the view is rendered first time.
Thanks for your help,
Sandip.hi sandip,
Try this method
lo_table_sett TYPE REF TO if_salv_wd_table_settings.
lo_config_tab TYPE REF TO cl_salv_wd_config_table.
lo_config_tab = lo_ref_interface_controller->get_model( ).
lo_table_sett ?= lo_config_tab.
lo_table_sett ->SET_SELECTION_MODE( value ).
value- '00' for auto
'02' for single
'04' for multi
'06' for none
'07' for singleNolead
'08' for multi Nolead
Regards,
janakiram -
Unable to lead select the table
Hi All ,
i i have some requirement something like this i have three table side by side in a view when i select the row of the first table the data in the second table should be dislayed and similarly for the third table as well .
Now my problem is when i am lead selecting the first table i a able to fetch the data and display but i am unable to lead select that rows in the table to display the lead selection i used Lead selection by Index then is is displaying properly BUT when i click on the second row or the third row or so...... It is not getting lead selected. I am Surprised i tried to check but did not found a single clue please help me with this.......
Good Day....................
Thanks and Regards,
Sana.hi ,
did u check the LeadSelect property of ur context node to which ur table is binded ?
http://help.sap.com/saphelp_nw04s/helpdata/EN/79/555e3f71e41e26e10000000a114084/content.htm
regards,
amit -
Dynamic SQL statement to select the tables which are updated today...
Hi Guys,
I need to find the names of all the tables which contain rows that are inserted/updated in a given time stamp...
Below statement gives me the list of all the tables in the database...
select t.table_name from all_tables t;All these tables in the database have a column called rowversion which gives the updated/inserted date of a record. I need to write a select statement (probably dynamic) which will give me the table names which contain the rowversion value 24-01-2013....
Any help is very much appreciated...Napster wrote:
Hi Karthick,
Thanks for your reply...
But when I execute your select statement I am getting an error saying table SYS.DBMS_XMLGEN does not exist.
Probably something wrong in my environment?Yes you can, here is a quick untested code
declare
my_filter date := to_date('24-01-2013', 'dd-mm-yyyy');
my_count integer;
begin
for i in (select table_name from user_tables)
loop
execute immediate q'[select count(*) from ]' || i.table_name || q'[ where rowversion = :1]'
using my_filter
into my_count;
if my_count > 0 then
dbms_output.put_line(i.table_name);
end if;
end loop;
end;
/ -
Tableview setting to enable to select the table columns to display
Hi All,
In webdynppto in the table ALV display we have the settings option with which users can control what columns of the table to display and what columns to hide in the table display.
Users can also control the columns of the display to show or hide in the display. Can any of you please clarify how we can do this with the tableview
The tableview I am using is below what setting do I need to enable to get the column display/hide by users at runtime
Thanks
Karen
<%@page language="abap" %>
<%@extension name="htmlb" prefix="htmlb" %>
<htmlb:content design="design2003" >
<htmlb:page>
<htmlb:form>
<htmlb:tableView id = "tv1"
visibleRowCount = "10"
selectionMode = "lineEdit"
table = "<%= flights %>"
filter = "SERVER"
sort = "server"
iterator = "<%= iterator %>" />
</htmlb:form>
</htmlb:page>
</htmlb:content>hello,
I do not think it's possible dynamically like ALV...on screen itself...
to hide / display a column you can code in iterator class with some condition...
Thanks, -
How can I display "detailStamp" facet selectively for rows in a table ?
Hi,
My JDEV version is Studio Edition Version 11.1.1.5.0
I am trying to display "detailStamp" facet selectively .
If I read api in link below
http://docs.oracle.com/cd/E26098_01/apirefs.1112/e17488/oracle/adf/view/rich/component/rich/data/RichTable.html
Use the "detailStamp" facet on the Table to include a collapsable content area for each table row. Please note that the height of the open detail area will be a set height based on the height of the detailStamp component. Adding a component that changes in height (like showDetail or panelBox) will by default produce strange results when the detailStamp component's height changes.
Detail Stamp can be selectively displayed for rows in the table by EL binding the "rendered" attribute of the "detailStamp" facet to "true" or "false". The EL binding can contain references to the table "var" attribute since during rendering it will be executed in the context of the row. Disclosure icon is displayed only for rows which have rendered="true".
I can see that i can achieve it by setting rendered property for that facet. BUT this property is not available in Studio Edition Version 11.1.1.5.0Hi Frank.
Thanks for your quick reply .
But I am using Studio Edition Version 11.1.1.5.0 . In this version the property RENDERED of f:facet name="detailStamp" is NOT allowed.
Edited by: user13764942 on Feb 7, 2013 5:48 AM
Put in another way , I want to render the "detailStamp" facet selectively for rows , so for that I need the RENDERED property of "detailStamp" facet. This property is ONLY available in Jdev version 11.2 . I am using Jdev 11.1.1.5.0 so I need some alternative to RENDERED property as this property is NOT available in Jdev 11.1.1.5.0.
Please suggest some way to achieve this behaviour of displaying "detailStamp" facet selectively ....
Thanks!
Edited by: Mangpal Singh on Feb 7, 2013 11:57 PM -
Select Multiple Rows in a Table without CTRL
Expecting the user to press "Ctrl" when selecting multple rows is very unfriendly and unintuitive. We'd like the row selection to work as in ALV where you just select multiple rows by clicking on them.
We've set the tables rowSelectable to true and selectionMode to 'multi' but we still cannot select multiple rows without the CTRL hotkey.
This issue apparently [arose before|About selection in the table] but wasn't resolved.
System Details
SAP_ABA 701 0006 SAPKA70106
SAP_BASIS 701 0006 SAPKB70106
SAP_AP 700 0019 SAPKNA7019Hello Marc,
you need to call IF_WD_CONTEXT_NODE->set_selected(index = lv_index) sorry for the typo in my previous comment.
by calling IF_WD_CONTEXT_NODE->set_selected method wont remove the lead selection.
to unselect the records, you can call the same method by passing the FLAG value as abap_false.
so for your usecase the logic will be like this in the ON_SELECT event handler
1. get the index of the new_lead_selection
2. check whether this is already seleted in the context node by calling IF_WD_CONTEXT_NODE->IS_selected
3. if already selected then call IF_WD_CONTEXT_NODE->set_selected( flag = abap_false index = lv_index)
if not selected then call IF_WD_CONTEXT_NODE->set_selected( index = lv_index )
Hope this solved your problem.
BR, Saravanan
Edited by: Saraa_n on Jul 6, 2011 11:52 AM -
How to select one row in a table with radio button
Hi all.
I have a VO where there is an attribute (isDefault [String]) that identifies the default record in the view. The possible values are 'Y' for yes and 'N' for no. Obviously only one record can have the 'Y' value.
In my page I have created an ADF Table (with the usual data control drag & drop). I would to transform the default inputText of "isDefault" field with a selectOneRadio component in order to permit the user to select (and save contextually in the DB) the default row of this table.
Can you explain me how? I'm using JDeveloper 11.1.1.4.
Thanks in advance.
BaduelBaduel wrote:
Cvele,
thanks for your responses. Yes, it's easier to use af:selectBooleanCheckbox but I need that the selection is mutually exclusive (only one row can be selected). >If this is possible also with the boolean checkbox please tell me how.- Let's try with CheckBox :
1. At the ViewObjectImpl level (for example, YourViewObjectImpl), add the following code:
private oracle.jbo.Key currSelectedRowKey = null;
public void doRowSelection(Key newKey) {
// de-select old one
if (currSelectedRowKey != null) {
Row[] rows = findByKey(currSelectedRowKey, 1);
if (rows != null && rows.length > 0)
rows[0].setStatusAsBoolean(Boolean.FALSE); // cast to the appropriate row Impl class if need !
// remember a new selected row key:
currSelectedRowKey = newKey;
}In the ViewRowImpl, in the transient attr settter, do as follows:
public void setStatusAsBoolean(Boolean value) {
setStatus(value.booleanValue() ? ONE : ZERO);
if (value.booleanValue()) {
YourViewObjectImpl vo = (YourViewObjectImpl)getViewObject();
vo.doRowSelection(getKey());
} P.S. The above was not tested at all, but should give you an idea
Maybe you are looking for
-
Relationship between tables while using inner joins.
Hi, I had a few clarifications on "inner joins", and as i was going through the forum, i came across two points, 1. In one of the threads it said " inner joins is applicable for tables that have a parent child relationship. 2. In another thread it sa
-
Hello everyone, I have been working with AOL for about three months now with no end in sight. I purchased a MacBook Pro in late September and attempted to use Mail (later Outlook with the same results) to download my Gmail and AOL email. I con
-
How many calls/texts do you miss with this phone?
Before I start: my phone is being replaced because the WiFi connection is completely broken, but I want to make sure this problem is not recurring when I get my new phone (the whole 14 day return thing, etc). My phone intermittently does not come out
-
how do I get safari to update the preview images automatically under top sites? (ver. 7.0.1)?
-
Hello to everibody. My question is simple, can i convert dynamically a page HTML to a document pdf? A greeting.