Refresh af:table when data in another table changes
Hi
I am using jdev 11.1.1.7.0 and using bean datacontols..
I have 2 tables in the same page..
1. Language table
2. Items table
Language table has CRUD operations like user can created new language. The items table is a dynamic table with one fixed column that is "item" and remaining are the language columns.
So, if user give 3 languages in first table then the second table will have "item" + 3 columns i.e 1 column for each language. .
Because these 2 tables are on the same page.. I need to refresh the items table to show new column when user creates new language in the language table.. what is the best way of doing this?
Thanks
Jdev 11.1.1.7 is not oficialy released yet, so I suppose you are Oracle employee, right ?
As I understand, you have you own internal forum, right ?
BTW, you probably have something like "Commit" button, or similar. So set partlalTrigger for the Items table to that Commit button...
Similar Messages
-
Update a table with data from another table
Hi to All,
I have in my 'schema' 2 tables:
CREATE TABLE T_ITEMS
ITEM_GROUP VARCHAR2(10 BYTE) NOT NULL,
ITEM_CODE VARCHAR2(25 BYTE) NOT NULL,
ITEM_DESCRIPTION VARCHAR2(40 BYTE) NOT NULL,
ITEM_QTA NUMBER(16,4),
ITEM_PRICE NUMBER(18,5)
TABLESPACE DOM8DATI
PCTUSED 0
PCTFREE 10
INITRANS 1
MAXTRANS 255
STORAGE (
INITIAL 2M
MINEXTENTS 1
MAXEXTENTS 2147483645
PCTINCREASE 0
BUFFER_POOL DEFAULT
LOGGING
NOCOMPRESS
NOCACHE
NOPARALLEL
MONITORING;
CREATE TABLE T_PRICES
ITEM_GROUP VARCHAR2(10 BYTE) NOT NULL,
ITEM_CODE VARCHAR2(25 BYTE) NOT NULL,
ITEM_PRICE NUMBER(18,5)
TABLESPACE DOM8DATI
PCTUSED 0
PCTFREE 10
INITRANS 1
MAXTRANS 255
STORAGE (
INITIAL 2M
MINEXTENTS 1
MAXEXTENTS 2147483645
PCTINCREASE 0
BUFFER_POOL DEFAULT
LOGGING
NOCOMPRESS
NOCACHE
NOPARALLEL
MONITORING;
I need to create a script that for each record in T_ITEMS, read if exist the code (ITEM_GROUP,ITEM_CODE) in T_PRICES and update ITEM_PRICE in T_ITEMS.
Can anyone help me?
Thank You and Best Regards
GaetanoMERGE INTO T_ITEMS B USING (
SELECT
ITEM_GROUP ,
ITEM_CODE,
ITEM_PRICE
FROM T_PRICES) E
ON (B.ITEM_CODE= E.ITEM_CODE)
WHEN MATCHED THEN
UPDATE SET B.ITEM_PRICE= E.ITEM_PRICE
WHEN NOT MATCHED THEN
INSERT (ITEM_GROUP ,
ITEM_CODE,
ITEM_DESCRIPTION ,
ITEM_QTA ,
ITEM_PRICE )
VALUES (E.ITEM_GROUP,
E.ITEM_CODE,
'UNKNOWN',
'UNKNOWN',
E.ITEM_PRICE);
COMMIT; -
Populating table with data from another table with fewer columns
Hi,
I have 2 tables:
Table 1:
Column 1
Column 2
Column 3
Table 2:
Column 1
Column 2
I want to populate Table 1 with all the data from Table 2, and populate Column 3 of Table 1 with numbers from a sequence. Is there a SQL stmt to do this? If not, what is the best way to do it in PL/SQL?
Thank you
ShailanCREATE SEQUENCE t1_seq
START WITH 1
INCREMENT BY 1
CACHE 100;
INSERT INTO t1( col1, col2, col3 )
SELECT col1, col2, t2_seq.nextval
FROM t2Justin
Distributed Database Consulting, Inc.
http://www.ddbcinc.com/askDDBC -
Updating a table with data from another table with joins involving 3 other
update party_relship pr
set pr.COMMENT_TEXT = temp.notes
from party p,
party p1,
party_reference pref,
TEMP_DEPT_NOTE temp
where pr.FROM_PARTY_ID = p.PARTY_ID
and p.CMA_CUSTOMER_NUMBER = temp.cma_num
and pr.TO_PARTY_ID = p1.PARTY_ID
and p1.PARTY_ID = pref.PARTY_ID
and pref.REFERENCE_VALUE = temp.deptnum
ORA-00933: SQL command not properly ended
What is the problem here.
Thanks !There are a few issues here 1) no from clause is directly part of the update stmt,
2) temp.notes is not available directly
I am not 100% sure this update is correct since I am selecting temp.notes using the same query as the in the where clause but I wanted to show the complete syntax. Basically if you need to limit the number of updates done then change the select that is part of the exists clause, if you need to change the way the pr.comment_text is being set then to need to change the sub_query.
update party_relship pr
set pr.comment_text =
(select temp.notes
from party p,
party p1,
party_reference pref,
temp_dept_note temp
where pr.from_party_id = p.party_id
and p.cma_customer_number = temp.cma_num
and pr.to_party_id = p1.party_id
and p1.party_id = pref.party_id
and pref.reference_value = temp.deptnum)
where exists(select 1
from party p,
party p1,
party_reference pref,
temp_dept_note temp
where pr.from_party_id = p.party_id
and p.cma_customer_number = temp.cma_num
and pr.to_party_id = p1.party_id
and p1.party_id = pref.party_id
and pref.reference_value = temp.deptnum)Message was edited by:
Bob C -
How to read LONG RAW data from one table and insert into another table
Hello EVERYBODY
I have a table called sound with the following attributes. in the music attribute i have stored some messages in the different language like hindi, english etc. i want to concatinate all hindi messages and store in the another table with only one attribute of type LONG RAW.and this attribute is attached with the sound item.
when i click the play button of sound item the all the messages recorded in hindi will play one by one automatically. for that i'm doing the following.
i have written the following when button pressed trigger which will concatinate all the messages of any selected language from the sound table, and store in another table called temp.
and then sound will be played from the temp table.
declare
tmp sound.music%type;
temp1 sound.music%type;
item_id ITEM;
cursor c1
is select music
from sound
where lang=:LIST10;
begin
open c1;
loop
fetch c1 into tmp; //THIS LINE GENERATES THE ERROR
temp1:=temp1||tmp;
exit when c1%notfound;
end loop;
CLOSE C1;
insert into temp values(temp1);
item_id:=Find_Item('Music');
go_item('music');
play_sound(item_id);
end;
but when i'm clicking the button it generates the following error.
WHEN-BUTTON-PRESSED TRIGGER RAISED UNHANDLED EXCEPTION ORA-06502.
ORA-06502: PL/SQL: numeric or value error
SQL> desc sound;
Name Null? Type
SL_NO NUMBER(2)
MUSIC LONG RAW
LANG CHAR(10)
IF MY PROCESS TO SOLVE THE ABOVE PROBLEM IS OK THEN PLESE TELL ME THE SOLUTION FOR THE ERROR. OTHER WISE PLEASE SUGGEST ME,IF ANY OTHER WAY IS THERE TO SOLVE THE ABOVE PROBLEM.
THANKS IN ADVANCE.
D. PrasadYou can achieve this in many different ways, one is
1. Create another VO based on the EO which is based on the dest table.
2. At save, copy the contents of the source VO into the dest VO (see copy routine in dev guide).
3. commiting the transaction will push the data into the dest table on which the dest VO is based.
I understand that if we attach VO object instance to region/page, we only can pull and put data in to only one table.
if by table you mean a DB table, then no, you can have a VO based on multiple EOs which will do DMLs accordingly.Thanks
Tapash -
Copying Long Raw Column Data to another table
hi everyone,
i am trying to Copy Long Raw Column Data to another table in the same schema. this is the situation
Table A (col1 number,col2 long raw) with 100 records
Table B (col1 number,col2 long raw) with 0 records
now i want to copy col2 of the table A into the column 2 of the table B. but long raw data cant be retrieved in a select statement so is there any specific procedure that will copy long raw data or there is any simple way.
i will be really grateful for anybody's help.
thanx
shakeelDust off that old SQL*PLUS command "COPY" ...
create table tablea (col1 number,col2 long raw)
insert into tablea values (1, testrawio.chartoraw('this is line one'));
insert into tablea values (2, testrawio.chartoraw('this is line two'));
insert into tablea values (3, testrawio.chartoraw('this is line three'));
create table tableb (col1 number,col2 long raw)
copy from scott/tiger@larry insert tableb (col1, col2) using select col1, col2 from tablea
Array fetch/bind size is 15. (arraysize is 15)
Will commit when done. (copycommit is 0)
Maximum long size is 80. (long is 80)
3 rows selected from scott@tiger.
3 rows inserted into TABLEB.
3 rows committed into TABLEB at DEFAULT HOST connection.
SQL>Now to prove it has worked :
begin
for lr in (select col1, col2 from tableb)
loop
dbms_output.put_line('col1 = '||lr.col1||
' and col2 contains long raw equivalent of '||testrawio.rawtochar(lr.col2));
end loop;
end;
col1 = 1 and col2 contains long raw equivalent of this is line one
col1 = 2 and col2 contains long raw equivalent of this is line two
col1 = 3 and col2 contains long raw equivalent of this is line three
PL/SQL procedure successfully completed.
SQL> Note : In order to load some test data and prove the method works I made use of a package called "testrawio" located at http://www.classicity.com/oracle/htdocs/forums/ClsyForumID125/7.html
AMM -
How to get the data from one table and insert into another table
Hi,
We have requirement to build OA page with the data needs to be populated from one table and on save data into another table.
For the above requirement what the best way to implement in OAF.
I understand that if we attach VO object instance to region/page, we only can pull and put data in to only one table.
ThanksYou can achieve this in many different ways, one is
1. Create another VO based on the EO which is based on the dest table.
2. At save, copy the contents of the source VO into the dest VO (see copy routine in dev guide).
3. commiting the transaction will push the data into the dest table on which the dest VO is based.
I understand that if we attach VO object instance to region/page, we only can pull and put data in to only one table.
if by table you mean a DB table, then no, you can have a VO based on multiple EOs which will do DMLs accordingly.Thanks
Tapash -
How to trigger a workflow when data inside a table changes
Hi
How to trigger a workflow when data inside a table changes ??
We need to trigger a workflow when STAT2 field value in PA0000 table changes.
rgds
ChemmanzMake use of Business Object BUS1065. In this business Object you have an attribute Status which you can use. There are a number of events that will get triggered when the status is changed.
Thanks
Arghadip -
Data from another table, to be displayed on table based screen
I have a block that is based on one table, if I found the record(s) on that table I will display it on the forms, No Problemo. But, if record(s) was not in the said table, I have to get the data on another table and then display it on the same forms. Is there someone who can show me how I can get the data from another table and display it on screen that is based on another table?
suppose you have 2 table emp_n and emp with same table structure
first check data from emp_n if not found then go to emp
try it:-
you will change block name at run time(query data source)
by
emp_n is old
emp is new
set_block_property('emp_n',QUERY_DATA_SOURCE_NAME,'emp');
if no data found in emp_n table then
change the block query name by
set_block_property('emp_n',QUERY_DATA_SOURCE_NAME,'emp');
in next try it will go to emp table for fetching record
kuljeet pal singh -
Table control data to databse table
Hi Experts,
I have created Table control on screen . After entering no of rows of data manually in Table control and after clicking on save button, entered data should be get saved into the corresponding table.
Please help me on this issue.
Thanks & Regards,
Nagaraju C.program znmodpl2.
tables : zntable.
data : it_table type table of zntable with header line.
controls : tabcntrl type tableview using screen 100.
data : ok_code type sy-ucomm.
*& Module STATUS_0100 OUTPUT
text
module status_0100 output.
set pf-status '0100'.
set titlebar '100'.
move-corresponding it_table to zntable.
endmodule. " STATUS_0100 OUTPUT
*& Module USER_COMMAND_0100 INPUT
text
module user_command_0100 input.
case ok_code.
when 'INS'.
it_table-carrier = zntable-carrier .
it_table-personnelno = zntable-personnelno.
it_table-flightname = zntable-flightname.
it_table-flightdate = zntable-flightdate.
it_table-f_name = zntable-f_name.
it_table-l_name = zntable-l_name.
it_table-rol_emp = zntable-rol_emp.
it_table-telephone = zntable-telephone.
it_table-city_dept = zntable-city_dept.
it_table-city_arrv = zntable-city_arrv.
append it_table.
insert into zntable values it_table.
message 'SUCCESSFUL INSERTION OF DATA' type 'S' .
when 'EXIT'.
leave program.
endcase.
endmodule. " USER_COMMAND_0100 INPUT
The Flow Logic will be :
process before output.
loop at it_table with control tabcntrl.
module status_0100.
endloop.
process after input.
loop at it_table .
module user_command_0100.
endloop.
thank & regards,
Nilay Sarkar. -
How to fetch the Table Control data to Customer Table(Z-Table) ?
How to fetch the Table Control data to Customer Table(Z-Table) ?
Hi Krishna,
Check this sample programs
http://www.planetsap.com/online_pgm_main_page.htm
http://sap.niraj.tripod.com/id29.html
http://www.sapdevelopment.co.uk/dialog/tabcontrol/tc_basic.htm
Have a look at below links. It will help you.
http://help.sap.com/saphelp_nw04/helpdata/en/9f/dbac5135c111d1829f0000e829fbfe/content.htm
http://help.sap.com/saphelp_nw04/helpdata/en/9f/dbac1d35c111d1829f0000e829fbfe/content.htm
Thanks,
Reward If helpful. -
Populate ADF Rich Table taking data from two tables of database
Hi,
Can anyone please guide me as to how I can populate ADF Rich Table taking data from two tables A and B of a database.
The condition is
I want to fetch row 1 from table A and populate into ADF Rich Table at row 1
then
I want to fetch row 1 from table B and populate into ADF Rich Table at row 2
and so on....
Many thanks for your help..
Regards,
RohitThe better place where you will learn:
http://download.oracle.com/docs/cd/E12839_01/web.1111/b31974/bcquerying.htm -
How to Refresh The Page When The Value of selectinputData Changes
Hi;
I have a select input date component and I want to refresh the page when the value of selectinputdate changes. What is the way to do it?
Also what is the way to do the same thing with choosedate component?
Thank you very much...Hi Turhan,
You may want to read about the Partial Page Refresh (PPR) capabilities in ADF Faces. You can make the selectInputDate's partialSubmit property "true" and then cause the specific components you wish refreshed have their partialTriggers property set to the ID of the selectInputDate.
Hope this helps,
John -
Refresh LOV after inserting data in correspondent table
Hi all,
I am using Jdeveloper 11.1.1.2 and ADFBC.
I have a page with a table (tableA) with some fields. One of them has a LOV associated to another table(tableB). I have a button (button1) that shows a popup(popup1) and opens a new task flow with a fragment to insert data in the tableB.
After inserting/modifying rows in tableB and after pressing commit (property: end-transaction) or rollback buttons (property: end-transaction and restore save point), LOV does not refresh.
I have tried to set the property partial triggers of the LOV to button1 or popup1 and it does not work.
How can I solve it?
Thank you.
AndreaHow about VO for table B ? Did you refresh that ? I didn't use the same VO for table & LOV.
so in "List data Source" -- VO -- I am using "SQL statement" and statement includes fields from Table B and Table A.
VO for LDS using "Rows populated by a SQL query with read-only access". I didn't use "Updateable Access through Entity Objects".
Sample of VO of LDS:
select A.model_number modelNumber, a.part_number partNumber, b.MODEM_TYPE ModemType
from table A a,Table B b
where a.PART_NUMBER_ID = b.PART_NUMBER_ID
and a.part_number_id =:partID
Edited by: albertpi on Mar 16, 2010 7:26 AM -
Procedure to insert data into table by selecting data from another table
Hi all,
I have to create a procedure where i have to select the data from one table and insert it into another table. Any help on this. And i have to update the 2nd table also when ever new records got inserted in the 1st table then.
RegardsHi, you can try something like:
CREATE [OR REPLACE] PROCEDURE procedure_name
IS
BEGIN
INSERT INTO TABLE1
VALUES (SELECT * FROM TABLE2);
END;
For the other part you may create a trigger on the first table AFTER INSERT to insert the values in the second table too.
Maybe you are looking for
-
K7T266 Pro R and Geforce 2 GTS problem
Hello everyone. I have been experiencing a problem for some time now regarding lockups and crashes caused by my video card, which vary in severity depending on the driver version used. Since I'm using an MSI K7T266 Pro Raid mobo (version 1) I thought
-
HT4914 Purging downloaded iTunes Match songs from iOS to keep memory available.?
It states that if your iOS system downloads the music from iCloud as you listen to it so its there for listening when no wifi is available! How do you purge the songs after listening so they don't take up space?
-
Problem with the splash screen
Hi, since a week the splash screen (the "about box" with version of ps etc.) of photoshop cs5 extended is at the wrong position. Normally this one is in the middle of my screen, but now it is on the top. The splash screens of Indesign and Illustrator
-
Is there any way to not show the device password on start-up?
The device is set to automatically show its password on start up. Is there any way to hide the password so it does not show?
-
HT5772 How do I cancel the app that I have purchased
I would like to cancel an application that I have purchased. I am being charged on a weekly basis for this app and I do not use it. If i just delete the icons I am still going to get craged or no? Can some one give me the answer please, I could not f