Get all Rows in table
Hi All
I'm developing web app using jd 11.1.1.4
In my web page I have a table with several rows. In one column I have a selectOneChoice to select the status.
I want to change status of several records and approve them at once.
How to iterate through all rows of the table in the backing bean.
Thanx
the iterator rowset will have all the rows..
DCIteratorBinding dciter;
BindingContainer bindings = BindingContext.getCurrent().getCurrentBindingsEntry();
dciter = (DCIteratorBinding) bindings.get("findAllTestAndryIter");
RowSetIterator rs = dciter.getRowSetIterator();
for(Row r : rs){
r.setAttribute("Status", "Y");
}
Similar Messages
-
How to get all rows in table to red using alternate rows properties option
How to get all rows in table to red using alternate rows properties option
Hi Khrisna,
You can get all rows red by selecting the color red in the "Color" and "frequency" to 1 under the "Alternate Row/Column colors".
I tried doing it and the colors freaked me out (all red) :-D
Kindly tell me if im missing something.
Regards,
John Vincent -
How to get selected row from table(FacesCtrlHierBinding ).
I'am trying to get selected row data from table:
FacesCtrlHierBinding rowBinding = (FacesCtrlHierBinding) tab.getSelectedRow();
Row rw = rowBinding.getRow();
But import for oracle.adfinternal.view.faces.model.binding.FacesCtrlHierBinding cannot be found from my JDev 11.
What is correct package for FacesCtrlHierBinding?Hi, another problem.
I fill table with data manualy from source:
<af:table var="row" value="#{getCompanyData.com}"
rowSelection="single" columnSelection="single"
editingMode="clickToEdit"
binding="#{getCompanyData.tab}"
selectionListener="#{getCompanyData.GetSelectedCompany}">
<af:column sortable="false" headerText="col1">
<af:outputText value="#{row.id}"/>
</af:column>
<af:column sortable="false" headerText="col2">
<af:outputText value="#{row.name}"/>
</af:column>
<af:column sortable="false" headerText="col3">
<af:outputText value="#{row.phone}"/>
</af:column>
</af:table>
and when I'am trying to use method to get selected row:
RichTable table = this.getTab(); //get table bound to UI Table
RowKeySet rowKeys = table.getSelectedRowKeys();
Iterator selection = table.getSelectedRowKeys().iterator();
while (selection.hasNext())
Object key = selection.next();
table.setRowKey(key);
Object selCompany = table.getRowData();
JUCtrlHierNodeBinding rowData = (JUCtrlHierNodeBinding) selCompany;
row = rowData.getRow();
I got an error:
SEVERE: Server Exception during PPR, #1
javax.el.ELException: java.lang.ClassCastException: data.COMPANY cannot be cast to oracle.jbo.uicli.binding.JUCtrlHierNodeBinding
When I created tables by dragging data from date control, all worked fine.
What could be a problem? -
All rows in table do not qualify for specified partition
SQL> Alter Table ABC
2 Exchange Partition P1 With Table XYZ;
Table altered.
SQL> Alter Table ABC
2 Exchange Partition P2 With Table XYZ;
Exchange Partition P2 With Table XYZ
ERROR at line 2:
ORA-14099: all rows in table do not qualify for specified partition
The exchange partition works correct for the first time. However if we try to exchange 2nd partition it gives the error.
How do i solve this error?
How do i find rows which are not qualified for the specified portion. is there a query to find out the same?stephen.b.fernandes wrote:
Is there another way?First of all, exchange is physical operation. It is not possible to append exchanged data. So solution would be to create archive table as partitioned and use non-partitioned intermediate table for exchange:
SQL> create table FLX_TIME1
2 (
3 ACCOUNT_CODE VARCHAR2(50) not null,
4 POSTING_DATE DATE not null
5 ) partition by range(POSTING_DATE) INTERVAL(NUMTOYMINTERVAL(1, 'MONTH'))
6 ( partition day0 values less than (TO_DATE('01-12-2012', 'DD-MM-YYYY') ) )
7 /
Table created.
SQL> create index FLX_TIME1_N1 on FLX_TIME1 (POSTING_DATE)
2 /
Index created.
SQL> create table FLX_TIME1_ARCHIVE
2 (
3 ACCOUNT_CODE VARCHAR2(50) not null,
4 POSTING_DATE DATE not null
5 ) partition by range(POSTING_DATE) INTERVAL(NUMTOYMINTERVAL(1, 'MONTH'))
6 ( partition day0 values less than (TO_DATE('01-12-2012', 'DD-MM-YYYY') ) )
7 /
Table created.
SQL> create table FLX_TIME2
2 (
3 ACCOUNT_CODE VARCHAR2(50) not null,
4 POSTING_DATE DATE not null
5 )
6 /
Table created.
SQL> Declare
2 days Number;
3 Begin
4 FOR days IN 1..50
5 Loop
6 insert into FLX_TIME1 values (days,sysdate+days);
7 End Loop;
8 commit;
9 END;
10 /
PL/SQL procedure successfully completed.
SQL> set linesize 132
SQL> select partition_name,high_value from user_tab_partitions where table_name='FLX_TIME1';
PARTITION_NAME HIGH_VALUE
DAY0 TO_DATE(' 2012-12-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')
SYS_P119 TO_DATE(' 2013-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')
SYS_P120 TO_DATE(' 2013-02-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')
Now we need to echange partition SYS_P119 to FLX_TIME2 and then echange FLX_TIME2 into FLX_TIME1_ARCHIVE:
To exchange it with FLX_TIME2:
SQL> truncate table FLX_TIME2;
Table truncated.
SQL> alter table FLX_TIME1 exchange partition SYS_P119 with table FLX_TIME2;
Table altered.To exchange FLX_TIME2 with FLX_TIME1_ARCHIVE we need to create corresponding partition in FLX_TIME1_ARCHIVE. To do than we use LOCK TABLE PARTITION FOR syntax supplying proper date value HIGH_VALUE - 1 (partition partitioning column is less than HIGH_VALUE so we subtract 1) and then use ALTER TABLE EXCHANGE PARTITION FOR syntax:
SQL> lock table FLX_TIME1_ARCHIVE
2 partition for(TO_DATE(' 2013-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN') - 1)
3 in share mode;
Table(s) Locked.
SQL> alter table FLX_TIME1_ARCHIVE exchange partition
2 for(TO_DATE(' 2013-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN') - 1)
3 with table FLX_TIME2;
Table altered.
SQL> Same way we exchange partition SYS_P120:
SQL> truncate table FLX_TIME2;
Table truncated.
SQL> alter table FLX_TIME1 exchange partition SYS_P120 with table FLX_TIME2;
Table altered.
SQL> lock table FLX_TIME1_ARCHIVE
2 partition for(TO_DATE(' 2013-01-02 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN') - 1)
3 in share mode;
Table(s) Locked.
SQL> alter table FLX_TIME1_ARCHIVE exchange partition
2 for(TO_DATE(' 2013-02-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN') - 1)
3 with table FLX_TIME2;
Table altered.
SQL> Now:
SQL> select count(*)
2 from FLX_TIME1 partition(day0)
3 /
COUNT(*)
8
SQL> select count(*)
2 from FLX_TIME1 partition(sys_p119)
3 /
COUNT(*)
0
SQL> select count(*)
2 from FLX_TIME1 partition(sys_p120)
3 /
COUNT(*)
0
SQL> select partition_name from user_tab_partitions where table_name='FLX_TIME1_ARCHIVE';
PARTITION_NAME
DAY0
SYS_P121
SYS_P122
SQL> select count(*)
2 from FLX_TIME1_ARCHIVE partition(day0)
3 /
COUNT(*)
0
SQL> select count(*)
2 from FLX_TIME1_ARCHIVE partition(sys_p121)
3 /
COUNT(*)
31
SQL> select count(*)
2 from FLX_TIME1_ARCHIVE partition(sys_p122)
3 /
COUNT(*)
11
SQL> SY. -
How to get all rows of an attribute data from a table?
Hello.. I´m using Jdev 10.1.3.2
I have a table with 5 columns and N rows.
I need to create a backing bean method to count the value of all rows of a specifc column.
I use
JUCtrlValueBindingRef selectedRowData= (JUCtrlValueBindingRef)myTable().getSelectedRowData();
to get an attribute from a selected row. but How can get from all rows?
Thank you
VandréHi Vandré
I think this example of Steve Muench will help you.
"Recalc Sum of Salary at the View Object Level
This example illustrates a technique where a transient attribute of a view object is updated to reflect the total sum of some attribute of all the rows in the view object's default row set. The code to recalculate the sum of the salary is in the getSumOfSal() method in the EmpViewImpl.java class. The custom EmpViewRowImpl.java class for the view row implements the getter method for the SumOfSal attribute by delegating to this view object method. The EmpViewImpl class extends a base DeclarativeRecalculatingViewObjectImpl class that contains some generic code to enable declaratively indicating that one attribute's change should recalculate one or more other attributes. The EmpView defines the "Recalc_Sal" property to leverage this mechanism to recalculate the "SumOfSal" attribute. If you restrict the VO's results using the BC Tester tool, you'll see the sum of the salaries reflects the subset. If you add a new row or delete an existing row, the sum of sal is updated, too."
http://otn.oracle.com/products/jdev/tips/muench/recalctotalvo/RecalcTotalOfRowsInVO.zip
Good Luck -
How get all rows of a table with a BAPI
Hi,
how is it possible to get more then one row by calling a BAPI from the WD. In my Application I need the rows of a Table coming from the r/3 System. How is it possible to get all the rows after the first call? What is the logic behind it? My purpose is also to create an own BAPI.
regards,
Sharam
nullHi,
If I understand, you don't want display the result into a Web Dynpro Table. If so, after the execution, the result of your request is stored into the context. Then you don't really need to transfert the data from your context to an Java Array.
But if you want to do it, here is the code :
guess your result node called
nodeResult
Vector myVector = new Vector();
for (int i = 0; i < wdContext.nodeResult().size(); i++){
myVector.put(wdContext.nodeResult().getElementAt(i));
I hope this will answer to your question.
Regards -
Please suggest solution for deletion of all rows in table at a time
Suggest me pl/sql code for a push button in form to delete entire rows in a table.
BEGIN
LOOP
DELETE
FROM mytable(say table name)
WHERE ROWNUM < 20000;
EXIT WHEN SQL%ROWCOUNT = 0;
COMMIT;
END LOOP;
END;
I wrote this code but not deleted .
Execute immediate truncate table <tablename>; this code too not working.
What my need is I dont want to put entire block fields in the form, just I want to put a push button and when I pressed it must delete all rows in a particular table.
That I want to delete all rows form builder runtime not by entering sql.8.0 and then there delete the rows.
thanks in advance
prasanth a.s.to delete all records in a table, if you want to get good performance, then use:
FORMS_DDL('TRUNCATE TABLE your_table_name');
It is better than use DELETE FROM TABLE_NAME. But if you have condition in where clause, then you have to use DELETE FROM ... -
Snap all rows in table/document
I've been working through the book "Scripting InDesign with JavaScript." The script is originally for snapping columns, but I'm trying to snap all the rows in tables so I've changed the references to "rows." I've worked through to this point, but it still snaps only the row where the cursor is located. I'm not sure what I need to alter in order for it to snap every row.
//from Scripting InDesign with JavaScript
var myStories = app.activeDocument.stories
for( var i = 0; i < myStories.length; i++ )
for( var j = 0; j < myStories[i].tables.length; j++ )
for( var k = 0; k < myStories[i].tables[j].rows.length; k++ )
snapRow( myStories[i].tables[j].rows[k] )
function snapRow( myRow )
// get the size of em space
var em = myRow.cells[0].insertionPoints[0].pointSize;
myRow.height = '2p3';
// get horizontal offset of last insertion point in each cell
var myRightPosArray = myRow.cells.everyItem(
).insertionPoints[-1].horizontalOffset
// find the biggest value
var longest = maxArray( myRightPosArray )
// get position of left side of Row
var myLeftPos = myRow.cells[0].insertionPoints[0].horizontalOffset
// set Row height
myRow.height = (( longest - myLeftPos ) + em )
function getRow()
var mySel = app.selection[0];
if( mySel.parent.constructor.name == 'Cell' )
return mySel.parent.parentRow
else if( mySel.constructor.name == 'Cell' )
return mySel.parentRow;
alert( 'Cursor not in a table\ror illegal selection' );
exit();
function maxArray( myArray )
var temp = 0
for( var i in myArray )
temp = Math.max( temp, myArray[i] )
return tempHi,
Exam a function snapRow() ==> snapColumn() in original, probably.
It is a horizontalOffset property used to find a widest cell in column.
This is useless if the goal is to snap row's height.
There is .autoGrow property useful for rows.
You could combine this with maximumHeight & minimumHeight (or not)
So simplest way :
snapRow(myRow) {
myRow.autoGrow = true;
getRow() function is useless too
Jarek -
How to get all rows that are returned in inner sub query of select statemen
If a sub query in select statement returns more than one row than how to get all those returned rows in the final
output of the query .It will be all right if all column's value repeat and that multiple output of inner query comes
in another column .
How to get that ?As Frank said, you likely want a join, and likely an outer join to replicate the select in the projection. Something like:
SELECT id,stat, section, USER_ID concerned_person
FROM table_all,
left join table2
on room_id = sectoion and
sur_role = 'r001'
WHERE section IN (SELECT code
FROM t_area
WHERE dept= 'p002')An alternative, depending on where and how you are using the statement would be something like:
SQL> WITH t AS (
2 select 1 id from dual union all
3 select 2 id from dual),
4 t1 as (
5 select 1 id, 'One' descr from dual union all
6 select 1, 'Un' from dual union all
7 select 1, 'Une' from dual)
8 SELECT t.id, CURSOR(SELECT t1.id, t1.descr from t1
9 WHERE t1.id = t.id)
10 FROM t;
ID CURSOR(SELECTT1.ID,T
1 CURSOR STATEMENT : 2
CURSOR STATEMENT : 2
ID DESCR
1 One
1 Un
1 Une
2 CURSOR STATEMENT : 2
CURSOR STATEMENT : 2
no rows selectedJohn -
Cannot get all rows from cfProcResult
We upgraded one of our servers (A) from CF 6 to 7.02. Another
server (B) has CF 7.01.
On server B (CF 7.01) the code works (below), all rows of
each dataset are returned.
Now on server A (CF 7.02) all of the resulting datasets have
only the first record in them. If I add maxrows="-1" to each of the
cfProcResult tags there is no change. If I change that to
maxrows="100" then I can get the rows up to 100.
Is this a bug or is there a different means to return all
rows?It think its a bug. I got the same results under MX 7.0.2.
The topic of maxrows recently came up on another thread. I
did some searching and according to TechNote 18339 there was a
change with maxrow
"<cfquery maxrows=N> bug. ColdFusion MX (until ColdFusion
MX 7.0.1 CHF2) didn't pass maxrows to the underlying driver
(statement.setMaxRows())"
Given the results you're getting, it sounds like CF is
applying the maxrow to all of the resultsets, not just the one
where maxrows was declared. I suspect cfstoredproc's usage of
statement.setMaxRows() is incorrect. Thats just a guess though.
Bottom line, I think you'll need handle it manually.
Personally, I would recommend placing the row count logic in the
stored procedure (if possible). The overall results will be more
consistent and you won't have to worry about this kind of issue
again.
http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=tn_18339
http://livedocs.adobe.com/coldfusion/7/htmldocs/00000314.htm
http://www.remotesynthesis.com/blog/index.cfm/2006/3/23/Maxrows-Issue-in-CFQuery -
How to get all rows/cols in pivot even if fact values are not available
If I have a a result set and then pivot on it then only the side/top labels appear for items with fact values. Is there any way to achieve the following :
Result Set gives the following pivot table
Area1 Area3
country 1 100 10
country 3 200 20
If there any way to ensure that pivot shows all row and column values and then fills in 0 for the missing facts ?
ie.
Area1 Area2 Area3
Country1 100 0 10
Country2 0 0 0
Country3 200 0 20
hope this makes sense. Basically I have a static format Excel report that the information is exported to and sometimes at the beginning of the month the daily report does not show all rows.
Thanks
Kevinouter join your dimensions to the facts so that all the dimensions are there
-
How to Enable All rows in Table
Hi Friends,
I have to create table in firstview. My requirement is I will give 4 or 5 inputs at a time then click on save button that input data will be saved in ECC system
So in First View I have to create table by using apply template that time I have to pass all u201Cinput filedsu201D.
In that time the table having only first row editable and remaining rows will be disable. I need all rows in enable in that Table.
Or
My Requirement is how to enter multiple input detals at a time. At a time customer enter 4 or 5 inputs click on submit buttion that data will be saved in ECC System.
How to do this work.
Regards
Vijay Kalluri
Edited by: KalluriVijay on Mar 5, 2010 12:34 PMHi Vijay,
The number of editable rows in the table would be equivalent to the number of elements the node to which the table is bound contains. In your case, it might be only having one element for the node as so you can only see that row enabled while the rest of the rows are disabled. So, in case you want even the rest of the rows to be enabled then, you should just create more elements for the same node (with or without setting any of the attribute within).
Then, when you need to use the values in the table (existing or modified or new values), then loop through the table node and check if all the attributes within the node or the mandatory field value for the table entry is not nul, otherwise, ignore the corresponding table node element.
Rather, I would suggest you to have a button say "Add Rows" and within the action of the node, I would like you to create one more element for the table at the end. This way, you wont have any unnecessary element in the table to be checked for not holding any value.
Regards,
Tushar Sinha -
How to select all rows in table automatically after refreshing?
Hi,All
After refreshing the table,I want to select all rows,like MultipleButton's function.
How can I do?
Thanks
Smile.Hi,-Grif-
* Set the selected state for the given row groups
* displayed in the table. This functionality requires
* the 'selectId' of the tableColumn to be set.
* @param rowGroupId HTML element id of the tableRowGroup component
* @param selected Flag indicating whether components should be selected
function selectGroupRows(rowGroupId, selected) {
var table = document.getElementById("form1:table1");
table.selectGroupRows(rowGroupId, selected);
}I don't know that the parameter selected is a boolean,or the checkbox(radio button) id?
Thanks
Smile -
How to get all the custom tables created in database
Hi,
Is there any sql query present to fetch the name of all the custom tables(Not the tabless inbuilt tables which is given by oracle) present in any module like iExp,iRec or anything.
ThanksIt is difficult to differentiate custom tables from the seeded ones if there is no naming conventions followed during their creation. The custom schema or owner name can be used to differentiate them.
Thanks,
Neeraj -
Get all rows from a table control
Hi All,
I have a table control with one column. What function should I use to retrieve all the rows ? Do I need to iterate row by row and read each row or is it possible to do it in one function ?
Thanks,
Kanu
Solved!
Go to Solution.Supposing vells in the column have all the same data type, you can retrieve the whole column with a single instruction:
GetTableCellRangeVals (panel, control, VAL_TABLE_COLUMN_RANGE (1), array, VAL_COLUMN_MAJOR);
The array passed must be large enough to retrieve all data. Alternatively, you may substitute the macro VAL_TABLE_COLUMN_RANGE with the appropriate MakeRect instruction.In case your table was dinamically built, you can obtain the nu,ìmber of rows using GetNumTableRows and dimension your array accordingly.
The above macro is defined in userint.h together with some other useful macros that can be used to access data in a table.
There are some precautions to take in case of string values or some cell type (ring, combo box, button...) that are described in the hell for the function.
Proud to use LW/CVI from 3.1 on.
My contributions to the Developer Zone Community
If I have helped you, why not giving me a kudos?
Maybe you are looking for
-
hi there I have a problem of getting into my computer. When I switch it on it gives me the following messages: Windows Error Recovery Wndows failed to start. A recent hardware or software change might be the cause. If windows files have been damaged
-
Can you test webcam with the Echo / Sound Test Ser...
I wanted to see if my webcam's video is working with Skype, but I couldn't seem to use it when making a test call with the Echo / Sound Test Service. Do I have to make an actual call to test the webcam or is there another way? Thank you.
-
This is shivraj, from pune i have use windows 7 pro and windows live mail 2011 since 2010, but suddenly i have to face a problem, i have to move mail in reference folder, change mail subjects and date and data and show old mail, how to solve
-
Iphone not starting up, apple icon fading at start up
My iphone 5 will not turn on, the silver apple icon appears for 5 seconds and then thats it, the screen shuts off. when i plugged the phone into a charger or computer, the silver apple icon will appear and then fades out along with the screen display
-
Hello, I have two components, and I want to initialize one variable in one component and do variable++ in the other component and trace the number. These are the two components: MyComponent: <?xml version="1.0" encoding="utf-8"?> <mx:Canvas xmlns:mx=