XSQL Master Child
Dear All,
I need to develop the reports using XSQL. Generate the report as master child table relation wise.
I will give sample format of my report.
<MasterVaue>
<child-value></childvalue>
</mastervalue>
i.e
each department wise i want show the employee names
How we can achive in XSQL in ADF
TIA
Hi,
Can anyone helpout me.
- <ROWSET>
- <ROW num="1">
<DEPTID>100</DEPTID>
<EMP_ID>82</EMP_ID>
<NAME>Ganesh</CHGVALUE>
</ROW>
- <ROW num="2">
<DEPTID>100</DEPTID>
<EMP_ID>85</EMP_ID>
<NAME>Rajesh</CHGVALUE> </ROW>
</ROWSET>
- <ROW num="2">
<DEPTID>101</DEPTID>
<EMP_ID>81</EMP_ID>
<NAME>Raju</CHGVALUE> </ROW>
</ROWSET>
Here i need <DEPTID> wise employee details
TIA
Similar Messages
-
Master Child tables how to get the latest rows from both
Hi,
Need some help with the sql. I have two tables Master & Child. In my Master table I have multiple rows for the same record and in the child table also multiple rows for the same master row how can I get the latest one's from both.
For example Data in my Master table looks like
CONT_ID SEQ_NUM DESCRIPTION
1 189 Update 2
1 188 Update 1
1 187 NewNow in the child table for the same CONT_ID I may have the following rows
CONT_ID UPDATED_DATE STATUS
1 3/16/2010 2:19:01.552700 PM P
1 3/16/2010 12:29:01.552700 PM A
1 3/16/2010 12:29:01.552700 PM P
1 3/16/2010 12:19:01.552700 PM NIn my final query how can I get the row with seq_num 189 as it's the latest in Master table and from child table the row with status of P as it's the latest one based on the time. Here is the query i have but it returns the latest row from the child table only and basically repeats the master table rows as opposed to one row that is latest from both:
ThanksHi,
You can use the analytic ROW_NUMKBER function to find the latest row for each cont_id in each table:
WITH got_m_rnum AS
SELECT cont_id, seq_num, description
, ROW_NUMBER () OVER ( PARTITION BY cont_id
ORDER BY seq_num DESC
) AS m_rnum
FROM master_table
-- WHERE ... -- any filtering goes here
, got_c_rnum AS
SELECT cont_id, updated_date, status
, ROW_NUMBER () OVER ( PARTITION BY cont_id
ORDER BY updated_date DESC
) AS c_rnum
FROM child_table
-- WHERE ... -- any filtering goes here
SELECT m.cont_id, m.seq_num, m.description
, c.updated_date, c.status
FROM got_m_rnum m
JOIN got_c_rnum c ON m.cont_id = c.cont_id
AND m.m_rnum = c.c_rnum
AND m.m_rnum = 1
;If you'd like to post CREATE TABLE and INSERT statements for the sample data, then I could test this.
If there happens to be a tie for the latest row (say, there are only two rows in the child_table with a certain cont_id, and both have exactly the same updated_date), then this query will arbitrarily choose one of them as the latest. -
I have a form in which I have placed a subform in a SharePoint Web App.
I also have 2 controls on the form, from which I'd like to link to two columns on the subform. How can I have two Master/Child linking relationships to a subform.
In Access desktop, it is done in a window "Subform Field Linker", like this:
Master Fields: Child Fields:
<sorry I could not include a link until my account is verified>
Thanks,
KeithHi Bruce,
>>Are subforms in web apps different in this regard?<<
Yes, there are two kinds of database. In an on-premise environment, Access 2013 apps are hosted by SharePoint 2013 while the data is stored in SQL Server 2012. SharePoint 2013 provides authentication, authorization, and security for Access 2013 apps.
The back-end tables, views, macros, and queries are stored in a SQL Server 2012 database.
You can get more detail about Access 2013 web app from link below:
What's new for Access 2013 developers
How to: Create and customize a web app in Access 2013
Regards & Fei
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
Script for master child relation
we need script for maste child relation
if i insert or delete or update in master table it should reflect in child table after running procedure (not trigger).
fetch the value from master table and insert into child table using cursor.
for ex:
if i insert value in master table tab1 with column name emp_id, it should reflect other child table with the same column name emp_id.
insertions should only be done in master table. not in child table..
notes:it should be in cursorhallo
This is our procedure.the procedure works fine for loop 3 with cursor c3.
The other cursor 1 and cursor 2 are not working fine. they are fetching duplicate values(ex:D10,D10........).
In this procedure we are fetching values from 3 tables and putting values in a single table.
please find the solution the code is given below.
code
create or replace procedure employee_insert
is
cursor c1 is
select * from department where
not exists (select null from employee where employee.department_id=department.department_id);
p1 department%rowtype;
cursor c2 is
select * from jobs where
not exists (select null from employee where employee.job_id=jobs.job_id or employee.job_title=jobs.job_title);
p2 jobs%rowtype;
cursor c3 is
select * from project where
not exists (select null from employee where employee.proj_id=project.proj_id or employee.proj_name=project.proj_name);
p3 project%rowtype;
begin
for p1 in c1
loop
for p2 in c2
loop
for p3 in c3
loop
insert into employee (EMPLOYEE_ID,EMPLOYEE_NAME,
department_id,department_name,
DATE_OF_BIRTH,job_id,job_title,
HIRE_DATE,
SALARY,proj_id,proj_name,
PHONE_NUMBER,
ADDRESS,EMAIL) values('E'||employee_id_seq.nextval,
dbms_random.string('A', 8),
p1.department_id,
p1.department_name,
TO_DATE(TRUNC(DBMS_RANDOM.VALUE(2452641,2452641+364)),'J'),p2.job_id,p2.job_title,
TO_DATE(TRUNC(DBMS_RANDOM.VALUE(2452641,2452641+364)),'J'),
Round(DBMS_Random.value(10,50)),
p3.proj_id,p3.proj_name,
'98'||'42'||Round(DBMS_Random.value(1000,5000)),
dbms_random.string('A', 20),
dbms_random.string('A', 8));
end loop;
end loop;
end loop;
Exception
When others then
raise_application_error(-20001,'An error was encountered - '||SQLCODE||' -ERROR- '||SQLERRM);
End;
execute employee_insert;
/ -
Reg:Master Child Details - AdvancedTable
Team,
I have a below requirement.
1.Dept (Master Table)
2.Emp (Child Table)
I implemented above design in Advanced Table in Master-Child Fashion.
Please suggest me how to implement the below requirement .
1. I should allow the user add rows in Child Table. But For Dept(*IT*), i should render the child table as either read only or disable Add Row Button.
2. Can we implement dependent poplist in Master-Child Table ?
Regards
SridharSridhar
I know u Discuss about Master Detail page.
When User Select row of Master table a Event is fire we capture that event and find out That Dept name of that perticular row if Dept is IT then we Set SPEL value of Detail Table is true for Read only.
I hope it will Help U
Azad -
Master-Child relations with ODP??
I don't understand why I am having problems trying to build a simple master-child table relation with cascade delete using ODP .NET. With microsoft's providers, in the FILL command, you can specify the relationship in the fill command - Fill(dataset_name,relation_name). But in ODP .NET, it doesn't accept the relation_name as the second parameter, just the datatable. Why is that? are there any good examples out there that show working with Master-Child relations populated with Fill()? Any help would be greatly appreciated.
bump
-
Master child Package Example package
Hi Experts,
Can any of you guys please send some sample packages for master - child packages (dtsx files) which includes all configuration from an xml file to [email protected]?
XML conf --> Master --> Childs
I am new to SSIS and i just wanted to have a look at the options in those packages.
Regards
mukejeeHi Mukejee,
To setup the association between the parent package and child package, there are two approaches:
Through passing variables. Specify the child package for the Execute Package Task in the parent package, and then add a Parent package variable type configurations in the child package.
Through passing parameters. Specify the child package for the Execute Package Task in the parent package, and map the parent parameters and the child parameters. No additional actions are needed in the child package.
Besides, the XML Configurations for a package is not affected by the factor that whether it is a parent/child package of another package or not.
Here, I have created two SSIS 2012 packages with the parent-child relationship that you can download from my
SkyDrive. In the parent package, I create a variable VarMaster with the value “This is a parent package variable.” In the child package, I create a variable VarChild with the value “This is a child package variable”, and use a Script Task to display the
value of the VarChild variable. You can see that the Script Task returns different values when we run the parent package or run the child package.
Regards,
Mike Yin
TechNet Community Support -
Forms Builder Master Child relationship --- column datas gets hided.
Hi All,
I have a screen which have 5 columns. Out of which first 3 columns belong to Table A and 4th column belong to say Table B and the 5th column belong to Table C. There is a master Child relationship between Table A and Table B also between Table A and Table C.
The issue is, i enter the data for these columns in row wise. I enter all 5 columns with value and when i switch to next row, the 4th and 5th column's value gets hided.
Please suggest.
Thanks and Regards,
KirthiRaviKirthiRavi wrote:
Hi All,
I have a screen which have 5 columns. Out of which first 3 columns belong to Table A and 4th column belong to say Table B and the 5th column belong to Table C. There is a master Child relationship between Table A and Table B also between Table A and Table C.
The issue is, i enter the data for these columns in row wise. I enter all 5 columns with value and when i switch to next row, the 4th and 5th column's value gets hided.
Please suggest.
Thanks and Regards,hI KirthiRavi
You have relation with
Table A with Table B
Table A with Table Cwhen you switch a record to another record at bloc/table A, it's normal forms behavior it's will hide value of block/table B and C. when your click on associate row of block/table A it will show.
It's the form normal behavior for relationship.Hope you understand.
Hamid
Mark correct/helpful to help others to get right answer(s).* -
Maintaining Master-Child relationship during ODI transformation
ODI Gurus
For following requirement, we need the best approach to transform data from Source to Target instance(Both Source and Target instances are running on Oracle Database)
Tables in Source Instance
a) Source_Master
b) Source_Detail (One to many relationship with Source_Master)
Tables in Target Instance
a) Target_Master
b) Target_Detail (One to many relationship with Target_Master)
In ODI need to create interfaces to transform data from
a) SOUCE_MASTER table to TARGET_MASTER table and
b) SOUCE_DETAIL table to TARGET_DETAIL table
NOTE: Value for Primary Key column in Target Instance tables Target_Master and Target_Detail are generated from Database Sequence.
Once the transformation is completed using ODI, the master-child relationship should be maintained in Target Instance between Target_Master and Target_Detail table. How do we achieve this in ODI ?
Thanks
Uma ShankarFor this, create the first interface for MASTER, in the mapping for the primary key you should map the database sequence, something like: MYSCHEMA.MYSEQUENCE_NEXTVAL.
Create the second interface for DETAIL, and on the sources pane of the interface, drag the SOURCE_DETAIL and TARGET_MASTER datastores. Make the joing between the two using the keys from the source. In the Primary key mapping of the DETAIL_TARGET make sure you select the new PRIMARY KEY of the TARGET_MASTER, mapping in staging area. This "lookup" will be done in the target data server.
If you are going to be doing updates and inserts in the target, you should make sure you set the Update Key selected for each of the targets to the same keys as on the source (obviously you won't have the target values!)
If you are not going to do any updates, then use the IKM SQL Control Append rather than the incremental update IKM.
You can optionally set the COMMIT option of the first interface to NO, and only commit on completion on the second interface if you want to ensure the full 'all or nothing' transactionality - but bear in mind, large volumes of uncommitted changes use resources.... -
Displaying master child relationship using datatable??
Hello,
I want to display master child data using a datatable or a datalist or any other component ( if can be used for this purpose )....I mean i have a particular role and the nominees in that particular role to be displayed...how can this be achieved....any suggestions....thanks in advance.
thanks & regards,
Gaurav.For this, create the first interface for MASTER, in the mapping for the primary key you should map the database sequence, something like: MYSCHEMA.MYSEQUENCE_NEXTVAL.
Create the second interface for DETAIL, and on the sources pane of the interface, drag the SOURCE_DETAIL and TARGET_MASTER datastores. Make the joing between the two using the keys from the source. In the Primary key mapping of the DETAIL_TARGET make sure you select the new PRIMARY KEY of the TARGET_MASTER, mapping in staging area. This "lookup" will be done in the target data server.
If you are going to be doing updates and inserts in the target, you should make sure you set the Update Key selected for each of the targets to the same keys as on the source (obviously you won't have the target values!)
If you are not going to do any updates, then use the IKM SQL Control Append rather than the incremental update IKM.
You can optionally set the COMMIT option of the first interface to NO, and only commit on completion on the second interface if you want to ensure the full 'all or nothing' transactionality - but bear in mind, large volumes of uncommitted changes use resources.... -
Doubt about Master-Child relationships.
Hello,
I've a doubt about master-child relationships.
Any row in the master table need to has at least one row in the child table. What do I guarantee that?
Please, any ideas.
Thnx.If im correct you are asking that any row in master table should have a corresponding child record in detail
(transaction) table.
WELL , There is no compulsion that the child table should have a record linking to record in master table.
Master table is not depended on child table. Child table is dependent on data reference on master table.
Pls note that Master table is independent of the child table ( in terms of data reference only) .
This doesnt mean that if you want to delete the master records when child records exists. it gives an error in that case.
check the following example
SQL> create table master(n number primary key);
Table created.
SQL> insert into master values(1);
1 row created.
SQL> create table child(t number references master(n));
Table created.
Hello,
I've a doubt about master-child relationships.
Any row in the master table need to has at least one row in the child table. What do I guarantee that?
Please, any ideas.
Thnx. -
Get all records in multi selected master child tables
Hi,
I am using JDeveloper 11.1.1.4 version and using ADF-BC in my project.
I have a simple master child[one to many] relationship in my project.
In my view page,I display this master child [Ex: EmpVo1--->DeptVo2] as tables.
I have multi-slection enabled for master table.
My requirement is that,on multi selecting the rows in master tables,I want to get all the child records in my backing bean.
that is if a master row has 3 child records and another master row has 4 child records and on multiple selection of these two records in master table,I should get all the child records in my backing bean.
I need this to implement cascade delete functionality.
Following is sample piece of code
1) called on selecting the rows in master table
public void onRSCGrpSelect(SelectionEvent selectionEvent) {
// Add event code here...
ADFUtil.invokeEL("#{bindings.RscGroupVO1.collectionModel.makeCurrent}",
new Class[] { SelectionEvent.class },
new Object[] { selectionEvent });
RowKeySet rowKeySet = (RowKeySet)tblRSCGrp.getSelectedRowKeys();
CollectionModel cm = (CollectionModel)tblRSCGrp.getValue();
for (Object facesTreeRowKey : rowKeySet) {
cm.setRowKey(facesTreeRowKey);
JUCtrlHierNodeBinding rowData =
(JUCtrlHierNodeBinding)cm.getRowData();
Row row = rowData.getRow();
System.out.println("\n" +
row.getAttribute(0) + " :: " + row.getAttribute(1) +
" :: " + row.getAttribute(2));
System.out.println("Displaying Child Records");
displayChildRecords(row.getAttribute(0));
2. private void displayChildRecords(Object rscGrp) {
ViewObject rscMapVo = getRscMapViewObj();
RowSetIterator rsI = rscMapVo.createRowSetIterator(null);
while (rsI.hasNext()) {
Row row = rsI.next();
System.out.println("\n" +
row.getAttribute(0) + " :: " + row.getAttribute(1) +
" :: " + row.getAttribute(2));
rsI.closeRowSetIterator();
But the problem is that ,it is always giving me the last selected rows child record details
Please suggest the error I am doing.
Thanks,
PraveenYour problem is that you use makecurrent, which should not be used on a multi select table. Next if you have master detail relationship you should have a view link between them. In this case you can expose a method in you master to get the related child row. No need to get the VO itself as you can use the child iterator accessors to get the child record.
public void onRSCGrpSelect(SelectionEvent selectionEvent) {
// Add event code here...
RowKeySet rowKeySet = (RowKeySet)tblRSCGrp.getSelectedRowKeys();
CollectionModel cm = (CollectionModel)tblRSCGrp.getValue();
for (Object facesTreeRowKey : rowKeySet) {
cm.setRowKey(facesTreeRowKey);
JUCtrlHierNodeBinding rowData =
(JUCtrlHierNodeBinding)cm.getRowData();
Row row = rowData.getRow();
//cast to the right row class
EmpEmpVoRow empRow = (EmpEmpVoRow) row;
// now you cann access the child row iterator
RowSetIterator it = empRow.getDepVO();
//now you cna iterate over the child rows
System.out.println("\n" +
row.getAttribute(0) + " :: " + row.getAttribute(1) +
" :: " + row.getAttribute(2));
System.out.println("Displaying Child Records");
//use hte child rows here
}Not sure if the code compiles out of the box (doing this on the train :-)
Timo -
How to execute the second data block in master child form using lov
Hi All,
i am developed a new custom master child form using stacked canvas.Here i am taking two frames with diffrent data blocks.my point is i am enter the value from the lov in first frame automatically execute the second frame data block without button.
example:
fisrtdatablock:dept no(dept table).
second datablock:employee information(emp table).
select the dept value from lov automatically execute the second data block emp information.
can help me any one.
Regards,
sekhar.
Edited by: 994418 on 17 Mar, 2013 10:40 PM994418 wrote:
Hi All,
i am developed a new custom master child form using stacked canvas.Here i am taking two frames with diffrent data blocks.my point is i am enter the value from the lov in first frame automatically execute the second frame data block without button.
example:
fisrtdatablock:dept no(dept table).
second datablock:employee information(emp table).
select the dept value from lov automatically execute the second data block emp information.
can help me any one.
Hi, sekhar.
Welcome to the Oracle Forums. Please take a few minutes to review the following:
<ul>
<li>Oracle Forums FAQ
<li>Before posting on this forum please read
<li>10 Commandments for the OTN Forums Member
<li>How to ask questions the smart way
</ul>
Following these simple guidelines will ensure you have a positive experience in any forum; not just this one!
>
Your forms mode isn't clear. Is it in enter-query mode or insert mode.
what can you do ?
use a timer in post-change or when-validate-item trigger at deptno item at first data block. because go_block isn't supported by p-c or w-v-t trigger.
and at when timer expire, write your code to go second block and insert/query the associate date from emp table.
Hope you understand.
Hamid
If someone's response is helpful or correct, please mark it accordingly.* -
Hi,
I am using JDeveloper 11.1.1.4 version.
In my page I have master child relation to be displayed.
I am displaying this by following the standard adf-bc master child example.
i.e add the id of the master child as partialTrigger to the child table.
But my requirement is that, multiple row selection is enabled for the master table and when multiple rows are selected in master table,
child table should not display any records.
How can I achieve this??
Also,I have a details panel displayed right under master table which displays selected row values in a form.
Here also,when multiple rows are selected,I should not display any values in the details panel.
Please advice on how to achieve this.
Thanks,
PraveenHi,
have a selection listener set on tabe to bean method and in bean getAllSelectedRowKeys from table. If you get more than or equal 2 entries hide the detail panel or write code so that u reresh ur detail vo to contain no rows -
MASTER-CHILD REPORT in JASPER REPORT
Hi,
How can i print a Master and Two child details in a Pre Printed Bill using Jasper Reports?
Please give me some guid lines to achive this.
Thanks
Sureshhttp://forum.java.sun.com/thread.jspa?threadID=692499
Cross-post.
And please note that this is not a Jasper Reports support forum.
Maybe you are looking for
-
How to access BPM 11g payload or process varibles in ADF task flow
I am trying to view/edit data in a UI tied to a database using a foreign key, requestId. The foreign key comes from a BPM process where it is passed into the task flow, from a human task. The foreign key comes from process variables or payload values
-
Hello, Iu2019m having problems re-assigning some activities. When i make a slight alteration to an existing activity I added my note and reassigned the activity to another user to raise collection but it is coming up with the red message when I click
-
I am changing platforms and computers, Windows to Mac...new desktop and laptop; LR desktop installation kept failing...I had forgotten about the limit on the number of computers allowed. So I uninstalled LR in the old desktop and tried again, same re
-
FI12 & FBZP ( Bank accounts folder)
Hello Gurus, what is the difference between g/l account assigned while creaing account id in the house bank ( FI12) and the g/l account which is assigned while doing bank accounts ( In FBZP after ranking order ). When these 2 accounts will
-
File name vs. public class?
Could anyone tell me that why should the file name be the same as the only public class in that file? Is there any reason for this rule? Thanks in advance. I really appreciate it. David