Adding/deleting rows from a treeTable with a read-only view object
Hello --
I'm getting a JBO-25016 error when I go to delete a row from a treeTable. I want to create the hierarchy from a stored procedure, have the user add and remove nodes without calling back to the database. I will iterate through the tree and see what has changed and made the necessary updates on the database manually.
What is the correct method for adding/removing rows form the UI component?
Thanks!
Tom
Thank you, Amit! That did the trick.
Edited by: Tom on Apr 28, 2011 11:51 AM
Similar Messages
-
Read-Only view object won't give me it's row
Hi,
I have a read only view object which when executed has one row in it, but the next method returns null.
this is my code in the AM:
public Row getPerson() {
Row row = null;
ViewObject vo = getPersonsView1();
vo.setNamedWhereClauseParam("p_login_id", getUserPrincipalName());
vo.executeQuery();
System.out.println("rows:" + vo.getEstimatedRowCount());
if (vo.hasNext())
row = vo.next();
return row;
}and the console log:
06/09/15 10:37:57 [513] select person_id,
login_id,
orig_system_id,
person_type,
title,
preferred_name,
preferred_name ||' '||surname full_name,
first_name,
other_names,
surname,
phone_work,
email_address
from sys_persons
where person_type = 'Staff'
and login_id = :p_login_id
06/09/15 10:37:57 [514] Bind params for ViewObject: PersonsView1
06/09/15 10:37:57 [515] Binding null of type 12 for "p_login_id"
06/09/15 10:37:57 [516] *** DCDataControl.sync() called from :DCBindingContainer.refresh
06/09/15 10:37:57 [517] *** DCDataControl.sync() called from :DCBindingContainer.refresh
06/09/15 10:37:57 [518] **** refreshControl() for BindingContainer :rft_ConsolePageDef
06/09/15 10:37:57 [519] *** DCDataControl.sync() called from :DCBindingContainer.refresh
06/09/15 10:37:57 [520] *** DCDataControl.sync() called from :DCBindingContainer.refresh
06/09/15 10:38:00 [521] Column count: 12
06/09/15 10:38:00 [522] ViewObject: PersonsView1 Reusing defined prepared Statement
06/09/15 10:38:00 [523] Bind params for ViewObject: PersonsView1
06/09/15 10:38:00 [524] Binding param "p_login_id": banstey
06/09/15 10:38:00 rows:1
Source breakpoint occurred at line 38 of SystemServiceImpl.java.Note above System.out.println("rows:" + vo.getEstimatedRowCount()); returns:
06/09/15 10:38:00 rows:1
but when i debug with a break point in the above method if (vo.hasNext()) returns false.
I have tried doing row = vo.next(); without the if statement, but row still evaluates to null.
The VO returns one record in the BC4J tester and I have this exact method and VO defined in another project and it works there. Tearing my hair out with this one...
Brendentry RowSetIterator instead,
RowSetIterator it = vo.createRowSetIterator("myIt");
if(it.hasNext())
MyVORowImpl row = (MyVORowImpl)it.next()
//don't forget close the RowSetIterator
I guess you use the VO.next(), but the current row of the VO is the one you get from db, and his next is null... -
Oracle deleting rows from tables starting with the name PQ
hai friends
we are given access rights to delete only tables starting with PQ. HAVING PQ_NUM as primary key for all the PQ tables.
totally we have 6 tables. PQ_01,PQ_02, PQ_03,PQ_04,PQ_05,PQ_06.
ALL This tables will have one primary key. for example pq_01 willl have pq01_num as primarykey and pq_02 table will have pq02_num as primary
key.
pq01_num value will exist in all the primary key of pq tables.
i want query to delete rows from the pq tables based on the input value i give.
for example if i give primarykey value 122 then that value in pq tables should be deleted.
One more problem is there. pq_06 table does not have pq02_num column. here the column differs. it is pq06_num_req.
so give your idea of deleting the rows from pq tables
waiting
SI dont have access to databse,this is untested
declare
v_cmd varchar2(2000);
columnname varchar2(30);
input_value number:=??;
tabowner varchar2(30):=???
begin
--step 1 identify table
FOR sub IN (SELECT table_name table_to_delete
FROM all_tables
WHERE table_name LIKE 'PQ%'
and owner=tabowner
) LOOP
----step 2 identify column
v_cmd :='select t.column_name from all_constraints S,All_Ind_Columns T where
S.OWNER=T.TABLE_OWNER
AND S.TABLE_NAME=T.TABLE_NAME
AND S.INDEX_NAME=T.INDEX_NAME
and s.owner=tabowner
AND S.TABLE_NAME='||table_to_delete||'
and s.constraint_type='''P'';
execute immediate v_cmd into columnname;
--step 3 delete records
v_cmd := 'delete from '||tabowner||'.' ||
sub.table_to_delete || '
where '||columnname||'='||input_value;
execute immediate v_cmd;
commit;
END LOOP;
end;Edited by: user5495111 on Aug 11, 2009 6:35 AM -
Get var from InputText based on a "read only view"
Hi.
I have build some read only views from DB.
All my views are linked.And the Data of each View is shown with " selectOneChoice" or "inputText".
So far so good.
But now my 1.problem.
How can I get the value of the inputText ( coordinates" lat , long ") in a var to use it with a google maps function like
map.addOverlay(createMarker(new GLatLng(lat,long)))
2. problem
how can i change the readout value of the inputText from[i] 51,2456 to 51.2456 for example
Hope for your help!
ChrisHi,
Yes, I'am talking about ViewObjects in ADF Business Components.
Version view:
ADF Business Components 10.1.3.41.57
BPEL Designer 10.1.3.3.0 (Build 070615.0525)
CVS Version Internal to Oracle JDeveloper (client-only)
Java(TM) Platform 1.5.0_06
Oracle IDE 10.1.3.41.57
Struts Modeler Version 10.1.3.41.57
UML Modelers Version 10.1.3.41.57
Versioning Support 10.1.3.41.57
For UserInterface I'am using "Web Tier--->JSF--->JSF JSP
I've got 5 read only views: Region, Country, City, Location and Koord ( including all coordinates of Location)
Now I want to show a marker in googleMaps with these coordinates but it doesn't work.
function load() {
if (GBrowserIsCompatible()) {
var map = new GMap2(document.getElementById("map"));
map.addControl(new GSmallMapControl());
map.addControl(new GMapTypeControl());
map.setCenter(new GLatLng(51,6),1);
var Lat;
var Longi;
here starts my problem
map.addOverlay(createMarker(new GLatLng(Lat,Longi))) } }
</script>
<afh:body onload="load()" onunload="GUnload()">
<af:messages/>
<af:form id="frm">
</input>
<af:selectOneChoice id="navList1" autoSubmit="true"
value="#{bindings.LolaRegionV1.inputValue}"
label="#{bindings.LolaRegionV1.label}">
<f:selectItems value="#{bindings.LolaRegionV1.items}"/>
</af:selectOneChoice>
<af:inputText value="#{bindings.LolaKoordV1Lat1.inputValue}"
label="#{bindings.LolaKoordV1Lat1.label}"
required="#{bindings.LolaKoordV1Lat1.mandatory}"
columns="#{bindings.LolaKoordV1Lat1.displayWidth}"
partialTriggers="navList4" id="input1">
<af:validator binding="#{bindings.LolaKoordV1Lat1.validator}"/>
<f:convertNumber groupingUsed="false"
pattern="#{bindings.LolaKoordV1Lat1.format}"/>
</af:inputText>
<af:inputText value="#{bindings.LolaKoordV1Longi.inputValue}"
label="#{bindings.LolaKoordV1Longi.label}"
required="#{bindings.LolaKoordV1Longi.mandatory}"
columns="#{bindings.LolaKoordV1Longi.displayWidth}"
partialTriggers="navList4" id="input2">
<af:validator binding="#{bindings.LolaKoordV1Longi.validator}"/>
<f:convertNumber groupingUsed="false"
pattern="#{bindings.LolaKoordV1Longi.format}"/>
</af:inputText>
</af:form>
I cant'*t give out the value of Lat , Longi to show the Marker.But a simple example like
var x;
var y;
x = "51";
y = "6";
map.addOverlay(createMarker(new GLatLng(x,y)))
is running.
Thank you for help!
Christian
Message was edited by:
user585675
Message was edited by:
user585675 -
ExecuteWithParameter with Binds on several view objects
I thought I knew how to do this, but it has been a month or two, and can't seem to get the syntax right. I would really appreciate some guidance on this.
I'm using jdev 11 to create a basic page using ADF Faces. In the model, I have three seperate read only view objects based on queries I created in SQL Developer. I also have two lookup tables for use in LOVs to display names for IDs. In one of the views, I added two LOVs for id columns. I have one more lookup that displays name, id for Tech's.
All three views have the same named bind variable - :TechID
What I want is to have a single select box that displays the name column from Tech that will return the ID for TechID. When the user clicks the ExecuteWithParms, all three views should be refreshed and re-queried with the new bind value, and display the results. To see this work, I have been working with readonly tables, but eventually hope to use graphs for the three views.
Here is the general layout that I am trying to achieve.
Select One Choice (List of Techs with display set to name, and the return set to ID)
ExecuteWithParams button. Currenly have table1, table2, table2 in the partialtriggers field.
table1
ViewObject1 that has a named bind of :TechID
table2
ViewObject2 that has a named bind of :TechID
table3
ViewObject3 that has a named bind of :TechID
This seems like it should be easy to setup. Can this be done declaratively, or do I need code. If I need code, can I get a few hints?
Is there an example that has something similar that I can gleen how to accomplish this?
Thanks, KenTimo et al,
I still can't seem to get this to work. I finally worked through a problem with JDeveloper working (Feels like it has been April 1st for a week straight! (American Humor)). In trying to simplify this, I am asking if someone can create the following example use case based on the HR schema. I'm not asking for a paper, just 15 or so minutes from someone that is good at this to create a working example. Also, send me a zipped copy of the project, or make it available on your blog or other downloadable location.
Thanks for any help with this to really understand how to get JDeveloper to work for me.
Here are the specifics for a Highly desired example:
This is based on HR schema.
Read Only View Objects
-- LOCATION_LKUP
select
(street_address || ' ' || city || ', ' || state_province || ' ' ||to_char(postal_code) || ' ' || country_id) as location_name,
location_id
from
locations
order by country_id, location_name;
-- ViewObject DepartmentStuffView
select *
from departments
where location_id = :LOC_ID;
-- ViewObject EmployeeStuffView
select * from employees
where department_id in (select department_id
from departments
where location_id = :LOC_ID);
-- Modify the AppService and ViewObjects to expose Java code to
-- modify the (name)Impl.java file
AppService Code
public void updateViews(String locationID) {
// Get a reference to the ViewObjects
DepartmentStuffView vo1 = (DepartmentStuffView) getDepartmentStuffView1();
EmployeeStuffView vo2 = (EmployeeStuffView) getEmployeeStuffView1();
// Now have each view object requery itself with the new parameter
vo1.updatewithParam(locationID);
vo2.updatewithParam(locationID);
ViewObject Code
-- In both ViewObjects
-- (DepartmentStuffViewImpl.java and EmployeeStuffViewImpl.java),
-- add the following code at the bottom
public void updatewithParam(String locationID) {
setTechID(locationID);
executeQuery();
Layout:
Location Name: ComboBox <== Displays LOCATION_NAME, Returns LOCAION_ID
<Run Report> <== Button to run the process
Table1
The view object DepartmentmentStuffView
Table2
The View Object EmployeeStuffView
Expected Behavior:
Change the location in combo box and press the run report button.
The data in both views with bind variables get updated.
Extension:
Page can have search with multiple filters. The AppService can control
which views get updated with which values depending on selections. Common
use case.
Thanks so much, Ken -
ADF BC connection to SQL Server with parameterized variable for View Object
Hi everyone
I'm developing a BPM Application using Oracle BPM 11.1.1.5.0 and JDeveloper 11.1.1.5.0
Following the thread from the link below, since this is a new topic, I decided to open a new thread.
Re: ADF method call to fetch data from DB before the initiator page loads
what I'm trying to do is to get a record from a database and show it to the user on the initiator UI using ADF BC and not the Database Adapter.
I have been able to work with ADF BC and View Objects to get all the rows and show them to the user in a table.
However, when I try to run the same query in the parameterized form to just return a single row, I hit a wall.
In short, My problem is like this:
I have an Application Module which has an entity object and a view object.
My database is SQL Server 2008.
when I try to create a new read only view object to return a single row I face the problem.
The query I have in the query section of my View Object is like this:
select *
from dbo.Employee
where EmployeeCode= 99which works fine.
However when I define a bind variable, input_code for example, and change the query to the following it won't validate.
select *
from dbo.Employee
where EmployeeCode= :input_codeIt just keeps saying
>
incorrect syntax near ":"
>
I don't know if this has to do with my DB not being Oracle or I'm doing something wrong.
Can someone help me with this problem please?
thanks in advanceHi
This all seems complicated to me so I think my simplest way would be to use the java code in the aformentioned thread by Sudipto:
public String getUserLogin() throws WorkflowException,
BPMIdentityException,
BPMUnsupportedAttributeException {
String userId = "";
IWorkflowServiceClient wfSvcClient;
ITaskQueryService queryService;
IWorkflowContext wfContext;
// Get username of User Login
String contextStr = ADFWorklistBeanUtil.getWorklistContextId();
wfSvcClient = WorkflowService.getWorkflowServiceClient();
queryService = wfSvcClient.getTaskQueryService();
wfContext = queryService.getWorkflowContext(contextStr);
userId = wfContext.getUser();
return userId;
} I don't know where and how I should put the code to be called when the view object loads though.
I have created a class in the java class section of my view object which has two methods related to the bind variable input_empCode:
getinput_empcode and setinput_empcode , as expected.
however any code i try to put in those two would not be called at all!
for example:
public Integer getinput_empCode() {
//return (Integer)getNamedWhereClauseParam("input_empCode");
return 1444;
}and
public void setinput_empCode(Integer value) {
//setNamedWhereClauseParam("input_empCode", value);
setNamedWhereClauseParam("input_empCode", 666);
}It just keeps filled with the values in the bind variable section.
I don't know what I'm doing wrong here.
would you show me the way?
Thanks again -
Disable users from adding-deleting row/columns
we are running sharepoint 2010 and I would like to setup some type of persmission that will disable certain users from adding-deleting rows/columns.
any suggestions will be appreciated
thank youEach list in sharepoint can be assigned certain roles.YOu can break the inheritance for that list and assign a group as a new role to the list.The users belonging to that group will only have access to that list depending to what permissions you give that
group.The code goes something like this:
SPWeb web = (SPWeb)properties.Feature.Parent;
string ListName = "C";
SPList list = web.Lists[ListName];
list.BreakRoleInheritance(true);
string GroupName = "Owners";
SPGroup group = web.SiteGroups[GroupName];
SPGroupCollection removeGroups = web.SiteGroups;
foreach (SPGroup removeGroup
in removeGroups)
if(removeGroup.Name != GroupName)
SPPrincipal principal = (SPPrincipal)removeGroup;
list.RoleAssignments.Remove(principal);
SPRoleDefinition rDefination = web.RoleDefinitions.GetByType(SPRoleType.Administrator);
SPRoleAssignment rAssignment =
new SPRoleAssignment(group);
rAssignment.RoleDefinitionBindings.Add(rDefination);
list.RoleAssignments.Add(rAssignment);
list.Update(); -
Unable to delete rows from Target.
Hello everyone,
I am unable to delete rows from target data store. Here is what I have done.
Source Oracle 10g - staging 11g - Target Oracle 11g
I have implemented consistent set CDC on data model in staging and added 2 tables to CDC and turned on the journals . Both tables A and B are joined together via Column E (primary key of table A). Table A is the master table(has foreign key). Table B is child table. Target column consists of all the columns of both table A and B.
Following is what I am able to do and not to do
ABLE TO DO. If data is inserted into both or any of journalized tables I can successfully load the same in target by performing following steps. 1. Extend the consistency window at model level. Lock subscriber. Run the interface with any source table marked as Journalized data only. Unlock subscriber and purge journal.
ABLE TO DO. If data is updated in any of the journalized table, along with the steps mentioned above I can execute two interfaces. In one Interface table A marked as journalized data only Joined with table B and in second interface table B marked as Journalized data only joined to table a.
NOT ABLE TO DO If data is deleted from one or both tables it shows up as journalized data in JV$D<tablename> marked as D with date and subscriber name but when i run the interface by extending the window , locking subscriber executing both interfaces, unlock subscriber purge journals. no change takes place is Target. After unlocking subscriber step, journalized data gets removed from JV$D view. Please let me know what I am doing wrong here. How can rows delted from source can also be deleted from TARGET?
NOTE : In the flow table SYNC_JRNL_DELETES is YES
In moel under jounalized table tab Table have following order Table A folloed by Table B
Thanks in advance
GreenwichSorry I still do not get it. when you say "Its a legacy app", are you talking about the VB.NET app ?
If so then I repeat my self :-) Why not to connecting to the SQL server directly?
* even if you need information from several databases (for example ACCESS + SQL Server), in most cases, it is much better to connect directly and get each information to the app. Then in your app you can combine the information and analyse it
[Personal Site] [Blog] [Facebook]
Access app is the legacy app. -
Prevent user from deleting rows from all tables in his own schema
Hi,
How can I prevent user from deleting rows in all tables in his own schema.
I want the user to not able to delete rows from any existing or new tables that might be added in the future.
The user does not have the "DELETE ANY TABLE" system privilege.
Please advise.
Thanks.Nowadays, I'd also avoid triggers (if possible).
Sometimes, when I daydream, I'm rewriting a few applications that I've contributed to as a newbie, and I'm very ashamed of it nowadays.
From what I've experienced, in retrospective, the emphasis on teaching 'Oracle stuff' has been lying far too much on PL/SQL row-by-row oriented processing instead of letting Oracle 'crunch' sets at once.
Most of my debugging hours ended up in discovering one or more database triggers 'doing stuff automagically'.
Another nice blogpost: http://rwijk.blogspot.com/2007/09/database-triggers-are-evil.html
Regarding OP's question:
I would just rethink/reconsider this requirement completely.
Correctly implementing privileges and roles seems the best way to go, yes.
Triggers? Nah...
pre-post-edit, noticed thread got updated just before posting
Don't know what you mean with 'namedropping', but I think it's legitimate to point other readers to interesting Oracle related opinions/articles that do have a technical background and lots of interesting examples.
post dreaded OTN outage edit (from here)
Again: I would just rethink/reconsider this requirement completely.
Both trigger/vpd are being used to hide a design flaw here. -
Delete Rows from T1 which are Not in T2
Hi
I've 2 Tables like below
T1
N1
N2
2
11
2
22
3
33
8
44
8
88
T2
N1
N2
2
22
8
88
If I Run Delete query, I must delete Rows from T1 which are Not in T2
For example, I must delete Rows 1,3,4 from T1
So how to write that delete query? Please adviceDelete from T1
Where not Exists (select * from T2 Where t1.N1=t2.N1 and t1.N2=t2.N2)
--or
Delete t
From t1 t
left JOIN t2 m
ON m.N1=t.N1 and m.N2=t.N2
WHERE m.N1 is null and m.N2 is null
--Or
;With mycte as
select N1,N2 from T1
Except
select N1,N2 from T2
Delete t
From t1 t
INNER JOIN mycte m
ON m.N1=t.N1 and m.N2=t.N2 -
Cannot DELETE rows from LOV on running...is it a bug ??
One of the features I appreciated in the new version of JHeadstart is that we can now insert, modify and delete rows on LOV (even in the database).
We have just to check on Lookup properties :
Multi-row insert allowed
Multi-row update allowed
Multi-row delete allowed
I cheked all of them and on runnig I could insert and update records in LOV.
When I tried to delete records from LOV the system display information message "nothing to save" and in fact no records were deleted.
Normally since I checked the delete property it should be possible to delete rows from LOV
thanks for any HelpMonta,
I could reproduce this, it is a bug. Added to the fix list for the next release.
Thanks for reporting,
Steven Davelaar,
JHeadstart Team. -
Delete rows from table...Bizarre problem.
Folks
i HAVE this bizarre problem.
I hava a Java class which displays data read into a table with a delete
option by the side of each row.
Now lets assume you have 3 rows in the Table.
abc deleteButton
efg deleteButton
xyz deleteButton
When I click the first delete,that row gets deleted from the table.(perfect...)
Now I have 2 rows.
When I click on the first row,I get the error
'You clicked -1'
java.lang.ArrayIndexOutofBoundsException: -1 < 0.
Can anyone tell me why this is happening even though there are rows in the table.???
ActionListener al = new ActionListener() {
public void actionPerformed(ActionEvent e) {
System.out.println("You clicked row : " + table.getSelectedRow());
javax.swing.table.TableModel model = table.getModel();
Object o = model.getValueAt(table.getSelectedRow(),0);
//System.out.print(model.getValueAt(table.getSelectedRow(), 0));
//System.out.println();
MyDeleteFunction(o.toString());
// Delete row from window.
((DefaultTableModel)table.getModel()).removeRow(table.getSelectedRow());
table.revalidate();
table.repaint();Hi ritu,
This class is called
new DisplayCall_IDTodisconnect(hashTable);
its a long file.
its attached below.
The rows are displayed by reading a hashtable into a vector
and the vector is iterated and appended..
public class DisplayCall_IDToDisconnect {
public static JTable createTable(Vector data, String buttonLabel, ActionListener action){
return createTable(data.iterator(), buttonLabel, action);
public static JTable createTable(
Iterator dataIterator,
String buttonLabel,
ActionListener action) {
DefaultTableModel model = new DefaultTableModel() {
public boolean isCellEditable(int row, int col) {
return col == 1;
model.setColumnCount(2);
while (dataIterator.hasNext()) {
Object[] row = { dataIterator.next().toString(), null };
model.addRow(row);
DefaultTableColumnModel columnModel = new DefaultTableColumnModel();
columnModel.addColumn(new TableColumn(0, 100));
columnModel.addColumn(new TableColumn(1, 80,
new TableButtonCellRenderer(buttonLabel),
new TableButtonCellEditor(buttonLabel, action)
JTable table = new JTable(model, columnModel) {
public void valueChanged(ListSelectionEvent e) {
super.valueChanged(e);
table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
return table;
private static class TableButtonCellRenderer implements TableCellRenderer {
final JButton button;
TableButtonCellRenderer(String buttonLabel) {
button = new JButton(buttonLabel);
public Component getTableCellRendererComponent(
JTable table,
Object value,
boolean isSelected,
boolean hasFocus, int row, int column) {
return button;
private static class TableButtonCellEditor
extends AbstractCellEditor
implements TableCellEditor, ActionListener {
final JButton button;
final ActionListener callback;
TableButtonCellEditor(String buttonLabel, ActionListener callback) {
button = new JButton(buttonLabel);
this.callback = callback;
button.addActionListener(this);
public Component getTableCellEditorComponent(
JTable table,
Object value,
boolean isSelected,
int row, int column) {
return button;
public Object getCellEditorValue() {
return null;
public void actionPerformed(ActionEvent e) {
button.getParent().requestFocus();
callback.actionPerformed(e);
static JTable table;
Vector items;
final ClientManager clientMgr;
// Constructor.
public DisplayCall_IDToDisconnect(Hashtable callLegTable,ClientManager clientMgr){
Vector vCSeqnos = displayCSeqNos(callLegTable);
this.clientMgr = clientMgr;
JFrame frame = new JFrame("Disconnect Options");
/*Vector*/ items = new Vector();
Enumeration vEnum = vCSeqnos.elements();
while(vEnum.hasMoreElements()){
items.add(vEnum.nextElement());
ActionListener al = new ActionListener() {
public void actionPerformed(ActionEvent e) {
//System.out.println("You clicked row ,col: " + table.getSelectedRow()+
// table.getSelectedColumn());
javax.swing.table.TableModel model = table.getModel();
Object o = model.getValueAt(table.getSelectedRow(),0);
System.out.print(model.getValueAt(table.getSelectedRow(), 0));
System.out.println();
closeConnection(o.toString());
// Delete row from window too.
((DefaultTableModel)table.getModel()).removeRow(table.getSelectedRow());
table.revalidate();
table = DisplayCSeqNos.createTable(items, "Disconnect", al);
frame.getContentPane().add(new JScrollPane(table));
frame.pack();
frame.show();
} // End Constructor.
public void closeConnection(String s){
/*1. Disconnect the current session*/
this.clientMgr.disconnectCall(s);
/*2. refresh the Disconnect window*/
this.refreshWindow();
public Vector displayCSeqNos(Hashtable callLegTable){
Enumeration eNum;
String str;
Vector v = new Vector();
eNum=callLegTable.keys();
while(eNum.hasMoreElements()){
str = (String) eNum.nextElement();
//System.out.println("Key : " + str + " Value : " + callLegTable.get(str));
v.addElement(str);
return v;
} // End of displayCSeqNos. -
Hello,
I've got a JTable which is based on a 2-dimensional array, which contains my data. Now I want to delete several rows from the JTable. There's the possibility to modify my data-array by creating a new array which doesn't contain anymore the datasets I want to delete. Afterwards I can redraw the table and my rows are deleted. But I think that's a very complicated way to delete rows from a JTable. Can anybody tell me whether ther's an easier way to do so ? I'd really be pleased...
Thanx,
FindusWhen you create a TableModel using a two-dimensional array or a Vector of Vectors, a DefaultTableModel is created and it stores the data in its own Vector of Vectors. The DefaultTableModel supports methods for adding/removing rows of data. To remove the first row in the table you would do something like:
DefaultTableModel model = (DefaultTableModel)table.getModel();
model.removeRow( 0 );
Note: once you create the TableModel you should set your array to null as it is not used anymore. -
Deleting rows from very large table
Hello,
I need to delete rows from a large table, but not all of them, so I can't use truncate. The delete condition is based on one column, something like this:
delete from very_large_table where col1=100;
There's an index (valid, B-tree) on col1, but it still goes very slow. Is there any instruction which can help delete rows faster?
Txh in adv.
A.Your manager doesn't agree to your running an EXPLAIN PLAN? What is his objection? Sounds like the prototypical 'pointy-hair boss'.
Take a look at these:
-- do_explain.sql
spool explain.txt
-- do EXPLAIN PLAN on target queries with current index definitions
truncate table plan_table
set echo on
explain plan for
<insert query here>
set echo off
@get_explain.sql
-- get_explain.sql
set linesize 120
set pagesize 70
column operation format a25
column query_plan format a35
column options format a15
column object_name format a20
column order format a12
column opt format a6
select lpad(' ',level) || operation "OPERATION",
options "OPTIONS",
decode(to_char(id),'0','COST = ' || NVL(to_char(position),'n/a'),object_name) "OBJECT NAME",
cardinality "rows",
substr(optimizer,1,6) "OPT"
from plan_table
start with id = 0
connect by prior id = parent_id
There are probably newer, better ways, but this should work with all living versions of Oracle and is something I've had in my back pocket for several years now. It's not actually executing the query or dml in question, just running an explain plan on it. -
Delete music from the cloud with ipod touch
how do I delete songs from the cloud with ipod touch
What do you mean delete from iCloud?
If you only want songs downloaded to the iPod to show on the iPod go to Settings>iTunes and App Store and turn off Show all.
Maybe you are looking for
-
Automatic creation of Material Master at the time raising the PO !!!
Hello All, I am stuck in a scenario of our client which should be implemented (or mapped) in SAP. Scenario: At the time of creating the PO (in there legacy system -in house developed) they can choose the items from the existing master data or/and the
-
This icon appears (then promptly disappears) in the upper left hand corner of my Safari screen every time I go to a different web site. Does anyone know what it is and why it suddenly started to appear about 3 weeks ago? thanks! JL
-
Failed to install Flash Builder
Hi, I am using Adobe Cloud and start with some instalations I need but Flash Builder failed. The error is: Exit Code: 6 Please see specific errors and warnings below for troubleshooting. For example, ERROR: DW050 ... --------------------------------
-
Adobe Pro xi won't open in windows 8
I am downloading Adobe Pro and it downloads fine. When I try and open a document in it, it states it has stopped working and Windows will let me know if it finds a resolution - any ideas how to fix this?
-
Using JDeveloper 10.1.12with Windows Server 2008
When Addiing Radio Button and putting the Radio Button under a Button Group when you run the application when you select "Yes" the "No" disappears