Insert rows in the ViewObject
Hi forum,
I'm implementing an application that imports data into a database.
I insert 100.000 rows in a ViewObject and then I do a commit to the database after doing some operations in order to select which objects have to be imported.
Is it possible to insert more then one row at the time,that is, something like a massive insertion?
I'm asking this, because currently the application takes about 2 hours to perform the task.It's too long.
Thank you
Here's how I did it.
1) Create the commit operation in your data binding. Bind to your AM.
2) In your backing bean lookup the OperationBinding. (I used the ADFUtil.java from the StoreFrontModule example code for this.)
OperationBinding commitOperation = ADFUtils.findOperation("Commit");
3) Then just do:
commitOperation.execute();
Rodger...
Edited by: rodger63 on Jan 5, 2010 1:24 PM
Edited by: rodger63 on Jan 5, 2010 1:26 PM
Similar Messages
-
I'm trying to figure out how to insert rows in the middle
row 1
row 2
row 3
I need to insert 2 rows before row 2
I know I have to use the AddRow(1, Position) however after many tries, it doesn't seem to work or at least I don't know how to
insert the second row as if I do +1 it's not realy adequate, also, pVal.Row reports Row 2 and in the documentation it sais 0 based which is not right so I'm a bit confused on how to go about that.
Edited by: Marc Roussel on Aug 10, 2011 8:23 AM
Here's the whole thing, maybe you'll understand where I'm at :
I enter an ItemCode which is a kit. After the person enter the quantity, I pop a .NET Windows form which asks for questions and then after the questions I get back and add the lines but it seems that when I add the lines, I'm still on the line I was entering the kit and it overrides it instead of Adding the new row at the position I'm asking it to add the row.
Even if I do pVal.Row +1 or +2 or +3, it doesn't matter
Edited by: Marc Roussel on Aug 10, 2011 8:28 AMThe code below adds the 2 lines all right but then, a blank line after and the line that was already there below is destroyed. Don't ask me why and what is happening to that existing line which seems to have lost the ItemCode or I don't know what happened
CurrentLine = pVal.Row;
CurrentLine++;
oMatrix.AddRow(1, CurrentLine);
SAP.SetCellValue(oMatrix, SAPFramework.Enums.MARKETING_COLS.B1_ITEMCODE, CurrentLine, "01P38");
SAP.SetCellValue(oMatrix, "U_KitSeq", CurrentLine, NewKitSeq);
CurrentLine++;
oMatrix.AddRow(1, CurrentLine);
SAP.SetCellValue(oMatrix, SAPFramework.Enums.MARKETING_COLS.B1_ITEMCODE, CurrentLine, "03P12");
SAP.SetCellValue(oMatrix, "U_KitSeq", CurrentLine, NewKitSeq);
I did not know that doing a simple thing like this would be a hard business...
Edited by: Marc Roussel on Aug 10, 2011 9:15 AM -
InsertRow does not show the inserted row on the view
hello:
The code below works well and shows the row on the view when added. However, when there are several existing rows and I have to scroll to next pages. an insert button on that page does not show the new Row at all. Is there a way for me to see the row even if I scroll over to the last page and try an insert?
ViewObject myVO = this.getMyView();
Row newRow = myVO.createRow();
newRow.setAttribute("Id", myId);
myO.insertRow(newRow);
ThanksHi,
I also have problems with code above for inserting a new row.
When I insert a new row in a table and click on column header (to change sorting), that row (and any other new row before committing) disappears from table. And if I commit that table (without missing row), the missing row reappears with next refresh.
Selection in that table (using SelectOne component with Autosubmit=true) also doesn't work with new rows (with existing rows it works fine). Selection allways sticks on first inserted row!
Something weird is happening here...
Please help. -
Query filtering rows in the ViewObject but works fine when run in sql
Hello,
The below query returns 8 rows when run in SQL Plus but the same query when used in the viewobject, its only returning 4 rows. I tried in all possible ways but not sure what's happening.
SELECT
tt.assignment_number,
tt.tab_name,
tt.old_value,
tt.new_value,
tt.oracle_value
FROM TestTable tt
WHERE tt.ppa_id = :1
AND ((:2 IS NULL) OR (:3 = tt.old_col))
AND ((:4 IS NULL) OR (:5 = tt.new_col))
Any suggestions are appreciated.
Thanks
--KKTry this
OAViewObject OAViewB = (OAViewObject)OAAppl.findViewObject("DisplayDetailsVO");
OAViewB.setWhereClauseParams(null);
OAViewB.setWhereClauseParam(0,Integer.parseInt(Pid));
OAViewB.setWhereClauseParam(1,Changes_Flag);
OAViewB.setWhereClauseParam(2,Changes_Flag);
OAViewB.setWhereClauseParam(3,Oracle_Flag);
OAViewB.setWhereClauseParam(4,Oracle_Flag);
OAViewB.setMaxFetchSize(-1);
OAViewB.executeQuery();
Thanks
Shree -
Unable to insert rows in the Web ADI document
Hi,
I am facing issue with Web ADI document while inserting the new rows. I have configured the Web ADI to update the SIT information of employees. I am able to download the data, modify the data and upload it successfully. However, when I try to add new rows in the document, it says 'Context values cannot be changed'.
Could anyone help me out as to what needs to be done to add new rows to the sheet ?
Regards
JhansiThere are certain areas of the Web ADI template where information cannot be changed, particularly in the Context area. Trying to change values in this area will result in the error
-
Unable to insert rows into the table
My insert statement below is not correct, when i try run, its encoutering error "table or view does not exist".
Basically what i am doing here is collecting the table name in FOR variable which stores the table name in this variable. This variable, i am using as table. I know this is not the proper way, please let me how can insert the complete table rows with the following code.
DROP TABLE TEMP;
CREATE TABLE TEMP AS SELECT * FROM Comp WHERE 1=2;
DECLARE
I INTEGER DEFAULT 1;
S VARCHAR2(50);
begin
for C in (select TABLE_NAME INTO S from USER_TABLES where TABLE_NAME like 'CABLE%' and TABLE_NAME NOT like '%OLD' and Num_ROWS > 0 order by TABLE_NAME) loop
INSERT INTO TEMP SELECT * FROM c.TABLE_NAME;
dbms_output.put_line(c.table_name);
end loop;
end;
The above insert statement is not correct. How can i write proper way.
Thanks.
Best Regards
Arshaduser13360241 wrote:
My insert statement below is not correct, when i try run, its encoutering error "table or view does not exist".
Basically what i am doing here is collecting the table name in FOR variable which stores the table name in this variable. This variable, i am using as table. I know this is not the proper way, please let me how can insert the complete table rows with the following code.
DROP TABLE TEMP;
CREATE TABLE TEMP AS SELECT * FROM Comp WHERE 1=2;
DECLARE
I INTEGER DEFAULT 1;
S VARCHAR2(50);
begin
for C in (select TABLE_NAME INTO S from USER_TABLES where TABLE_NAME like 'CABLE%' and TABLE_NAME NOT like '%OLD' and Num_ROWS > 0 order by TABLE_NAME) loop
INSERT INTO TEMP SELECT * FROM c.TABLE_NAME;
dbms_output.put_line(c.table_name);
end loop;
end;
The above insert statement is not correct. How can i write proper way.
Thanks.
Best Regards
ArshadSTMT := 'INSERT INTO TEMP SELECT * FROM ';
STMT := STMT || S;
EXECUTE IMMEDIATE STMT; -
MAX(ROWID) and inserting rows at the end of the table
Hi,
I know this will be another lame question but I simply didn't find the answer anywhere. I create ID (primary key) for rows manually so I have this code:
String query = "SELECT * FROM CIS_SEG_SKUPINY WHERE ROWID=(SELECT MAX(ROWID) FROM CIS_SEG_SKUPINY)";
rset = stmt.executeQuery(query);
if (!rset.next()) {
<p style="padding-left:10px">newID = new Number(1);
System.out.println(newID);</p>
else {
<p style="padding-left:10px">rset.beforeFirst();
while (rset.next()) {
<p style="padding-left:20px">int lastID = rset.getInt("ID");
System.out.println(lastID);
newID = new Number(lastID + 1);
System.out.println(newID);
}</p>
}</p>
css.setId(newID);
Row globalsRow = getGlobals().first();
css.setKodSegSkupiny((String)globalsRow.getAttribute("GroupCode"));
css.setPopis((String)globalsRow.getAttribute("Description"));
css.setBarva((Number)globalsRow.getAttribute("Colour"));
getDBTransaction().commit();
When the table is empty newID is set to 1 and row inserted. Now I have one row in the table (with ID=1) so newID is set to 2 and row inserted BUT it is inserted BEFORE the first row. So when I try to insert third row lastID is 1 not 2. I tried to find some command which would insert new row after the last one but unfortunately I wasn't successfull.
Edited by: Herald on Mar 28, 2009 11:11 AMHerald,
I am sorry to say that there are so many things wrong with your approach, that I don't know where to begin...
1). ROWID is a pseudo column in Oracle.. It has no meaning of first, last, middle, or otherwise. SELECT MAX(ROWID) will get you some row.
2). In a relational database, there is no concept of first or last row in a table. If you expect the rows in some order, use an order by.
3). Ignoring your implementation and addressing your intent - you should not be creating a primary key by getting the max already in the table and adding one. You will, using your technique, get duplicates in a multi-user scenario. If you fix your implementation to not give duplicates in a multi-user scenario (no, I won't show you how), you will use a table lock, and therefor inhibit scalability in a serious way.
The proper and commonly accepted way to generate a numeric primary key in Oracle would be to use a sequence and a trigger to populate the sequence. Lots of examples to be found in this forum, but just have a read of the ADF Developers Guide for Forms/4GL Developers (for 10g) or the Fusion Developers Guide (for 11g) to find one. The term to search for would be DBSequence.
John -
ExcuteQuery does not return the newly inserted row in the database
Jdeveloper Studio Edition Version 11.1.1.4.0
I have a use case where i insert a row in the database (without commit) and re-query the iterator to see the data in the jsf page. This was working file till we were using a directly the data control. Now our data control is inside a primary data control and it has stopped working. We don't see the inserted record in the page. Just to add that we are creating both the master and the detail record using the database procedure. Please helps us with a workaround or a solution and i have attached the code for reference.
public void createSCAgr(ActionEvent actionEvent) {
BindingContainer bindings = getBindings();
OperationBinding operationBindingSC = bindings.getOperationBinding("createAgreement"); // this is calling a procedure to create record in the both master and detail table
Object resultSC = operationBindingSC.execute();
DCIteratorBinding iterator2 = ADFUtils.findIterator("PadForAgr1Iterator");
iterator2.executeQuery(); // re-query the master record
DCIteratorBinding iterator1 = ADFUtils.findIterator("FinForAgr1Iterator");
iterator1.executeQuery(); // requery thedetail record
best regards
Sanjay ChatterjiHi Timo,
Yes, I mean root application as the direct data control.
This has been working earlier and the difficult part is that it is still working fine for two of the screens. The screen in which it works are those which does not have master detail relationship in them.
We are using PL/SQL to create the new row as it involves using many database functions / packages to populate the base data for the freshly created row. which we use to get to the screen for further changes and commit.
We have been using this way for log time and it worked fine.
Sanjay Chatterji
Message was edited by: SChatterji -
I'm making a huge form in LiveCycle Designer. I want to be able to add rows in the middle o the table but in a way that the content below will move down automatically in a way it doe's in Word for example.
Sometimes I am adding a very high new row in the middle of a page and I want the content in the below rows to be moved to another page and if it is necessary I want a new page to be automatically created on the bottom of a document or something.
Is this possible or do I have to move everything by hand if I add new row to a table?If you are adding the rows at the runtime by clicking a button, then you have to use the instance Manager to add rows.. It will add rows at the end and then you need to write code to move the row at the desired location by using the moveInstance method of the instanceManager.
If you are adding a row at the design time, then you can right clcik the row and choose to add rows below.
Thanks
Srini -
Inserting row in the result set
Hi
need to insert a row in resultset when previous row typ=c and next row typ=p then need to insert one row in between typ c and p with typ =s see the #temp_result table for result expected
--drop table temp1
--drop table temp1_result
--presently data:-
create table temp1
(id int,
ord int,
typ varchar(2),
dt date)
insert into temp1 values (101, 1, 'c', '2001-10-01')
insert into temp1 values (101, 2, 'p', '2001-11-11')
insert into temp1 values (102, 1, 'c', '2002-10-01')
insert into temp1 values (102, 2, 'p', '2002-11-01')
insert into temp1 values (102, 3, 'p', '2002-12-01')
insert into temp1 values (103, 1, 'c', '2003-10-01')
insert into temp1 values (103, 2, 'p', '2003-11-01')
insert into temp1 values (104, 1, 'c', '2004-10-01')
insert into temp1 values (104, 2, 'c', '2004-11-01')
insert into temp1 values (104, 3, 'p', '2004-12-01')
insert into temp1 values (105, 1, 'c', '2005-10-01')
insert into temp1 values (105, 2, 'p', '2005-11-01')
insert into temp1 values (105, 3, 'c', '2005-12-01')
insert into temp1 values (106, 1, 'c', '2006-08-01')
insert into temp1 values (106, 2, 'p', '2006-09-01')
insert into temp1 values (106, 3, 'c', '2006-10-01')
insert into temp1 values (106, 4, 'p', '2006-11-01')
insert into temp1 values (106, 5, 'p', '2006-12-01')
select * from temp1
order by id, ord
--result expected:-
create table temp1_result
(id int,
ord int,
typ varchar(2),
dt date)
insert into temp1_result values (101, 1, 'c', '2001-10-01')
insert into temp1_result values (101, 2, 's', '')
insert into temp1_result values (101, 3, 'p', '2001-11-11')
insert into temp1_result values (102, 1, 'c', '2002-10-01')
insert into temp1_result values (102, 2, 's', '')
insert into temp1_result values (102, 3, 'p', '2002-11-01')
insert into temp1_result values (102, 4, 'p', '2002-12-01')
insert into temp1_result values (103, 1, 'c', '2003-10-01')
insert into temp1_result values (103, 2, 's', '')
insert into temp1_result values (103, 3, 'p', '2003-11-01')
insert into temp1_result values (104, 1, 'c', '2004-10-01')
insert into temp1_result values (104, 2, 'c', '2004-11-01')
insert into temp1_result values (104, 3, 's', '')
insert into temp1_result values (104, 4, 'p', '2004-12-01')
insert into temp1_result values (105, 1, 'c', '2005-10-01')
insert into temp1_result values (105, 2, 's', '')
insert into temp1_result values (105, 3, 'p', '2005-11-01')
insert into temp1_result values (105, 4, 'c', '2005-12-01')
insert into temp1_result values (106, 1, 'c', '2006-08-01')
insert into temp1_result values (106, 2, 's', '')
insert into temp1_result values (106, 3, 'p', '2006-09-01')
insert into temp1_result values (106, 4, 'c', '2006-10-01')
insert into temp1_result values (106, 5, 's', '')
insert into temp1_result values (106, 6, 'p', '2006-11-01')
insert into temp1_result values (106, 7, 'p', '2006-12-01')
select * from temp1_resultregards
Edited by: @2**** on 31-Jan-2012 06:48Well, in an Oracle database, something like this...
SQL> ed
Wrote file afiedt.buf
1 with temp as (select 101 as id, 1 as ord, 'c' as typ, date '2001-10-01' as dt from dual union all
2 select 101, 2, 'p', date '2001-11-11' from dual union all
3 select 102, 1, 'c', date '2002-10-01' from dual union all
4 select 102, 2, 'p', date '2002-11-01' from dual union all
5 select 102, 3, 'p', date '2002-12-01' from dual union all
6 select 103, 1, 'c', date '2003-10-01' from dual union all
7 select 103, 2, 'p', date '2003-11-01' from dual union all
8 select 104, 1, 'c', date '2004-10-01' from dual union all
9 select 104, 2, 'c', date '2004-11-01' from dual union all
10 select 104, 3, 'p', date '2004-12-01' from dual union all
11 select 105, 1, 'c', date '2005-10-01' from dual union all
12 select 105, 2, 'p', date '2005-11-01' from dual union all
13 select 105, 3, 'c', date '2005-12-01' from dual union all
14 select 106, 1, 'c', date '2006-08-01' from dual union all
15 select 106, 2, 'p', date '2006-09-01' from dual union all
16 select 106, 3, 'c', date '2006-10-01' from dual union all
17 select 106, 4, 'p', date '2006-11-01' from dual union all
18 select 106, 5, 'p', date '2006-12-01' from dual)
19 --
20 -- end of test data
21 --
22 select id
23 ,row_number() over (partition by id order by ord, typ) as ord
24 ,typ
25 ,dt
26 from (
27 select id
28 ,ord
29 ,case when rn = 2 and add_typ = 's' then add_typ else typ end as typ
30 ,case when rn = 1 then dt else null end as dt
31 from (
32 select t.id, t.ord, t.typ, t.dt
33 ,case when typ = 'c' and lead(typ) over (partition by id order by ord) = 'p' then 's'
34 else null end as add_typ
35 from temp t
36 ) x
37 cross join (select rownum rn from dual connect by rownum <= 2)
38 where not (rn = 2 and add_typ is null)
39 )
40* order by id, ord
SQL> /
ID ORD T DT
101 1 c 01-OCT-2001 00:00:00
101 2 s
101 3 p 11-NOV-2001 00:00:00
102 1 c 01-OCT-2002 00:00:00
102 2 s
102 3 p 01-NOV-2002 00:00:00
102 4 p 01-DEC-2002 00:00:00
103 1 c 01-OCT-2003 00:00:00
103 2 s
103 3 p 01-NOV-2003 00:00:00
104 1 c 01-OCT-2004 00:00:00
104 2 c 01-NOV-2004 00:00:00
104 3 s
104 4 p 01-DEC-2004 00:00:00
105 1 c 01-OCT-2005 00:00:00
105 2 s
105 3 p 01-NOV-2005 00:00:00
105 4 c 01-DEC-2005 00:00:00
106 1 c 01-AUG-2006 00:00:00
106 2 s
106 3 p 01-SEP-2006 00:00:00
106 4 c 01-OCT-2006 00:00:00
106 5 s
106 6 p 01-NOV-2006 00:00:00
106 7 p 01-DEC-2006 00:00:00
25 rows selected. -
Newly inserted row in the Essbase isnot displaying with page refresh in ADF
Hi,
I have a pivot table in my UI page and I have a option to create new Measure in Essbase.
I am inserting new Measure in Essbase at runtime from Java Bean and refreshing the pivot table.
The newly added Measure is not displaying after refreshing the pivot table but when I reopen the page the new measure is displaying.
Could you please let me know how can I display the newly added Measure in ADF Pivot Table with refresh.
Thanks,
Swathi GHi Timo,
Yes, I mean root application as the direct data control.
This has been working earlier and the difficult part is that it is still working fine for two of the screens. The screen in which it works are those which does not have master detail relationship in them.
We are using PL/SQL to create the new row as it involves using many database functions / packages to populate the base data for the freshly created row. which we use to get to the screen for further changes and commit.
We have been using this way for log time and it worked fine.
Sanjay Chatterji
Message was edited by: SChatterji -
Inserting rows although the raise_application_error is raised
Hi,
I have created two triggers on a table (one before insert and the other after insert).
The after trigger calls a procedure...
The before insert trigger is as follows:
create or replace trg_
before insert on xf
or each row
begin
select a_date from y
where ...;
if x>:new.date_of_a_table_inserted_via_a_form
then
raise_application_error....
end if;
end;
Altough i insert a date value equal to a_date - not previous to a date which has already been inserted the trigger displays the error message (raise_application_error....(message)) but the row(s) are inserted....in the table.... Can you spot what may be wrong...????
many thanks,
SimonThe reason for this phenomenon (although an alert is displayed, the record is saved in the database) seems to be the ON-ERROR .pll library i have attached to the form....
The db trigger works absolutely right.....(to answer to a previous question/note)
In this library i have written if..elsif...elsif....end if; construct in order to catch various db errors.... The problem is focused in the management of user-defined errors , i have written in db triggers mainly.....
Can you pinpoint the error.....in bold below????
I have also pasted the code for errors (-2291,-1,-2290) in order - maybe- the logic.....
PROCEDURE PRC_DISPLAY_ERROR IS
CONSTRAINT_NAME_VAR ALL_CONSTRAINTS.CONSTRAINT_NAME%TYPE;
AL_ID ALERT;
AL_N NUMBER;
DBMS_ERROR_CODE_VAR NUMBER;
DBMS_ERROR_TEXT_VAR VARCHAR2(3000);
DBMS_ERROR_FIELD_VAR VARCHAR2(30);
DBMS_ERROR_TEXT_TABLE_VAR VARCHAR2(60);
ALERT_CODE_VAR REF_ALERTS.ALERT_CODE%TYPE;
ALERT_MSG_VAR REF_ALERTS.ALERT_MSG%TYPE;
HELP_MSG_VAR REF_ALERTS.HELP_MSG%TYPE;
INSTR_APO NUMBER(3);
INSTR_EOS NUMBER(3);
LENGTH_VAR NUMBER(3);
INSTR_APO_TABLE NUMBER(3);
INSTR_EOS_TABLE NUMBER(3);
LENGTH_TABLE_VAR NUMBER(3);
SEARCH_CONDITION_VAR ALL_CONSTRAINTS.SEARCH_CONDITION%TYPE;
CONSTRUCTED_TEXT_VAR VARCHAR2(4000);
CONSTRUCTED__TEXT_VAR VARCHAR2(4000);
ALL_STRING_VAR VARCHAR2(600);
FIELD_VAR VARCHAR2(30);
FIELD_VAR_ VARCHAR2(30);
TABLE_VAR VARCHAR2(30);
BEGIN
/*DBMS - ERRORS*/
DBMS_ERROR_TEXT_VAR:=DBMS_ERROR_TEXT;
DBMS_ERROR_CODE_VAR:=DBMS_ERROR_CODE;
/* FOREIGN/PRIMARY KEY , CHECK CONSTRAINT...*/
IF DBMS_ERROR_CODE_VAR IN (-2291,-1,-2290)
THEN
INSTR_APO:=INSTR(DBMS_ERROR_TEXT_VAR,'.',1)+1;
INSTR_EOS:=INSTR(DBMS_ERROR_TEXT_VAR,')',1);
LENGTH_VAR:=INSTR_EOS-INSTR_APO;
DBMS_ERROR_TEXT_VAR:=SUBSTR(DBMS_ERROR_TEXT_VAR,INSTR_APO,LENGTH_VAR);
BEGIN
SELECT DISTINCT B.ALERT_CODE , ALERT_MSG , HELP_MSG INTO ALERT_CODE_VAR , ALERT_MSG_VAR , HELP_MSG_VAR
FROM REF_ALERTS_DET A, REF_ALERTS B
WHERE A.ALERT_CODE=B.ALERT_CODE
AND CONSTRAINT_NAME = DBMS_ERROR_TEXT_VAR;
EXCEPTION
WHEN NO_DATA_FOUND
THEN
AL_ID:=FIND_ALERT('AL_NOTE');
AL_N:=SHOW_ALERT(AL_ID);
RETURN;
END;
AL_ID:=FIND_ALERT('AL_STOP');
SET_ALERT_PROPERTY(AL_ID,ALERT_MESSAGE_TEXT,ALERT_MSG_VAR||'.'||HELP_MSG_VAR);
AL_N:=SHOW_ALERT(AL_ID);
elsif ......
elsif.....
elsif DBMS_ERROR_CODE_VAR IN (-20000,-20001,-20002,-20003,-20004,-20005,-20005,-20006,-20007,-20008,-20009,-20010,
-20011,-20012,-20013,-20014,-20015,-20016,-20017,-20018,-20019,-20020,-20021,-20022,
-20023,-20024,-20025,-20026,-20027,-20028,-20029,-20030,-20031,-20032,
-20033,-20034,-20035,-20036,-20037,-20038,-20039,-20040,-20041,-20042,
-20043,-20044,-20045,-20046,-20047,-20048,-20049,-20050,-20051,-20052,
-20053,-20054,-20055,-20056,-20057,-20058,-20059,-20060,-20061,-20062,
-20063,-20064,-20065,-20066,-20067,-20068,-20069,-20070,-20071,-20072,
-20073,-20074,-20075,-20076,-20077,-20078,-20079,-20080,-20081,-20082,
-20083,-20084,-20085,-20086,-20087,-20088,-20089,-20090,-20091,-20092,
-20093,-20094,-20095,-20096,-20097,-20098,-20099)
THEN
INSTR_APO:=INSTR(DBMS_ERROR_TEXT_VAR,':',1)+1;
INSTR_EOS:=INSTR(DBMS_ERROR_TEXT_VAR,'ORA-',2)-1;
LENGTH_VAR:=INSTR_EOS-INSTR_APO;
DBMS_ERROR_TEXT_VAR:=SUBSTR(DBMS_ERROR_TEXT_VAR,INSTR_APO,LENGTH_VAR);
AL_ID:=FIND_ALERT('AL_STOP');
SET_ALERT_PROPERTY(AL_ID,ALERT_MESSAGE_TEXT,DBMS_ERROR_TEXT_VAR);
AL_N:=SHOW_ALERT(AL_ID);
END IF; -
Hi,
I have created two triggers on a table (one before insert and the other after insert).
The after trigger calls a procedure...
The before insert trigger is as follows:
create or replace trg_
before insert on x
for each row
begin
select a_date
from y
where ...;
if x>:new.date_of_a_table_inserted_via_a_form
then
raise_application_error....
end if;
end;Altough i insert a date value equal to a_date(has already been inserted) the trigger displays the error message (raise_application_error....(message)) but the rows are inserted....in the table.... Can you spot what may be wrong...????
many thanks,
Simonexception when others ... to do what....????
Thanks,
Simon -
How to query the rows of a ViewObject programatically?
Hi All,
I'm using View Objects(based on a SQL query) as part of my ADF form. At present my VO contains about 2500 rows. I need to programatically query these 2500 rows of the ViewObject for a particular row.
I'd like to know the best approach to do this.
At present, I am looping around the VO using a for loop, and getting RowAtRange(Index i) and checking each row. I know this is not the best way forward and would like to use any native VO/ADF methods to do this.
I'm not sure if getRowMatch is applicable?
UsingJDev : 11.1.1.4
Thanks
PP.You can use findByKey method, check this
http://baigsorcl.blogspot.com/2010/03/adf-how-to-find-rows-in-iterator.html -
Not able to insert row programticaly
hi am trying to insert row to another viewObject from another viewobject programaticaly ,can somebody help me,i have recreate the problem i upload it in hostfile,am in jdeveloper 11.1.1.6.0
am geting this log error
Caused by: oracle.jbo.InvalidOwnerException: JBO-29114 ADFContext is not setup to process messages for this exception. Use the exception stack trace and error code to investigate the root cause of this exception. Root cause error code is JBO-25030. Error message parameters are {0=UamUserdetails, 1=oracle.jbo.Key[marksn ]}
at oracle.jbo.server.EntityImpl.internalCreate(EntityImpl.java:1341)
at oracle.jbo.server.EntityImpl.create(EntityImpl.java:1020)
at oracle.jbo.server.EntityImpl.callCreate(EntityImpl.java:1197)
at oracle.jbo.server.ViewRowStorage.create(ViewRowStorage.java:1152)
at oracle.jbo.server.ViewRowImpl.create(ViewRowImpl.java:498)
at oracle.jbo.server.ViewRowImpl.callCreate(ViewRowImpl.java:515)
at oracle.jbo.server.ViewObjectImpl.createInstance(ViewObjectImpl.java:5714)
at oracle.jbo.server.QueryCollection.createRowWithEntities(QueryCollection.java:1993)
at oracle.jbo.server.ViewRowSetImpl.createRowWithEntities(ViewRowSetImpl.java:2492)
at oracle.jbo.server.ViewRowSetImpl.doCreateAndInitRow(ViewRowSetImpl.java:2533)
at oracle.jbo.server.ViewRowSetImpl.createAndInitRow(ViewRowSetImpl.java:2498)
at oracle.jbo.server.ViewObjectImpl.createAndInitRow(ViewObjectImpl.java:11042)
at worklis.view.beantest.addnew(beantest.java:138)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.el.parser.AstValue.invoke(Unknown Source)
at com.sun.el.MethodExpressionImpl.invoke(Unknown Source)
at org.apache.myfaces.trinidadinternal.taglib.util.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:53)
at org.apache.myfaces.trinidad.component.UIXComponentBase.broadcastToMethodBinding(UIXComponentBase.java:1256)
at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:183)
at org.apache.myfaces.trinidad.component.UIXCollection.broadcast(UIXCollection.java:148)
at org.apache.myfaces.trinidad.component.UIXTable.broadcast(UIXTable.java:279)
at oracle.adf.view.rich.component.UIXTable.broadcast(UIXTable.java:145)
at oracle.adf.view.rich.component.rich.data.RichTable.broadcast(RichTable.java:402)
at oracle.adf.view.rich.component.fragment.UIXRegion.broadcast(UIXRegion.java:148)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.broadcastEvents(LifecycleImpl.java:1018)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:386)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:194)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)Edited by: adf009 on 2013/02/15 4:43 PM
Edited by: adf009 on 2013/02/15 4:57 PM
Edited by: adf009 on 2013/02/15 7:22 PMthe code am using is below
public void addnew(ActionEvent actionEvent) {
// Add event code here...
// Add event code here...
//Code to get the bindings for TargetVO :
Map<Object,String> mp=new HashMap<Object, String>();
DCBindingContainer bindings2 =
(DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
JUCtrlHierBinding obj = (JUCtrlHierBinding)bindings2.findCtrlBinding("UamUserdetailsView2");
ViewObject targetVO = obj.getViewObject();
DCBindingContainer bindings =
(DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
DCIteratorBinding empIter =
bindings.findIteratorBinding("DeltTable1Iterator");
//SourceVO1Iterator is the iterator under Executables section for the SourceVO1 bindings.
RowSetIterator roleRSIters = empIter.getRowSetIterator();
RowSetIterator rs1 = roleRSIters.getRowSet().getViewObject().createRowSetIterator(null);
rs1.first();
NameValuePairs nvp = null;
String username = null;
while (rs1.hasNext()) {
Row r = rs1.next();
nvp = new NameValuePairs();
// nvp.setAttribute("organisationid", r.getAttribute("organisationid"));
nvp.setAttribute("Organisationid", getorgid());
System.out.println("printedorgid" +getorgid());
nvp.setAttribute("Username",r.getAttribute("Username"));
nvp.setAttribute("Username1",r.getAttribute("Username"));
nvp.setAttribute("Firstname",r.getAttribute("Firstname"));
nvp.setAttribute("Surname",r.getAttribute("Surname"));
nvp.setAttribute("Emailaddress",r.getAttribute("Emailaddress"));
// username = (String)r.getAttribute("Username");
System.out.println("prininstead " + nvp);
// targetVO.createAndInitRow(nvp);
r = targetVO.createAndInitRow(nvp);
targetVO.insertRow(r);
//createAndInitRow(AttributeList nvp);
//Row row = targetVO.createAndInitRow(nvp);
// targetVO.insertRow(row);
rs1.closeRowSetIterator();
targetVO.getApplicationModule().getTransaction().commit();
}i have re-created the problem i upload in this hostfile,you can have the whole picture of what am trying to do
http://www.4shared.com/zip/RaZ07PWS/createRow.html
Edited by: adf009 on 2013/02/15 7:36 PM
Edited by: adf009 on 2013/02/15 7:38 PM
Edited by: adf009 on 2013/02/15 8:01 PM
Maybe you are looking for
-
Problem with Recognition of Admin's Name and Password
I am having issues with my system not recognising my admin name and password. For example if I click the lock on the Accounts Preferences page to make changes or try to shut my system down with other users logged in I get a similar message telling me
-
Fresh install of 10.4.7 and crash and burn! A little help would be nice.
I did a fresh install of 10.4.7, there is no old information from the old system over to this new one. No user account info, not even desktop backgrounds yet... Everything has been done from scratch, the only updates I have done are the 10.4.7 combo
-
How do I make new tabs open to my specified home page instead of blank page?
How do I make new tabs open to my specified home page instead of blank page?
-
Custom Filter for Date on UWL iview
Hello Experts- I want to display previously approved tasks and current tasks in a UWL iview. As of now in the iview the taks which are displayed are the one which are pending. For this I am planning to add a custom filter to my UWL iview. Can anyone
-
Insert Editing, Why Won't Clips Appear In The Timeline?
Every time I attempt an insert edit, either via the "downward arrow" symbol or via "W" on the keyboard the clip appears in a secondary time/storyline below the Timeline, with a blank space in the main Timeline of exactly the same duration as the clip