Reg : "Flattened" Master/Detail in a Single Row
Hi All,
I have a requirement as below :
Structure Table. EO1
Attirubtes Table. EO2
The relation ship between two tables is one to one.
My requirement is i need to show the data in Flattened Format in a table region.
For display purpose i was able to display data.
For performing DML operations : Like : Insert, Update , Delete. I have take a VO1 based on two EO's : EO1 and EO2' , AO for EO1 && EO2. and written query in Expert Mode.
Here i struck, i could not understand how to proceed further. While performing update : only data in : EO1 is getting updated. EO2 data is getting committed.
One more issue is : i could not understand how to perform insertRow() for above ?
Please provide your suggestions.
Regards
Sridhar
Hi All,
I solved the above requirement by following the below link.
HOWTO: Implementing a ViewObject with Multiple Updateable Dependent Entity Objects
Thanks to AJ
Regards
Sridhar
Similar Messages
-
Several reports on joined master-detail tables with single row source
I have 1 master table (Fixed Assets) and several datail tables (Improvements, Depreciation, ...)
I need to create several reports based on them all with criteria
'Select ALL from Master and join details
/1 total row from details for 1 master row/
filtered by [on_date <= report_date]'
How to do it better and not copy same code in every report?
As mentioned on this forum, ApEx is not able to use RefCursor as row source for ApEx reports
So I tried this Tom Kyte's example:
create type apex_user.myRecordType as object
(seq int,
a int,
b varchar2(10),
c date
Create Or Replace Type Apex_User.Mytabletype As Table Of Apex_User.Myrecordtype;
create or replace function Apex_User.my_function return Apex_User.myTableType
Is
l_data Apex_User.myTableType;
Begin
l_data := Apex_User.myTableType();
for i in 1..5
loop
L_Data.Extend;
l_data(i) :=Apex_User.myRecordType(i, i, 'row ' || i, sysdate+i);
end loop;
Return L_Data;
End;
Select *
from TABLE (cast(Apex_User.my_function() as Apex_User.mytableType))
Where C > Sysdate+1
Order By Seq Desc
SEQ A B C
5 5 row 5 22.08.2010
4 4 row 4 21.08.2010
3 3 row 3 20.08.2010
2 2 row 2 19.08.2010
4 Rows Selected
- and it really works from ApEx reports.
The questions are:
1) is this the best solution for my task (one centralized code for several reports with parameter filtering detail tables)?
2) how to change example properly to have here -
loop
L_Data.Extend;
l_data(i) :=Apex_User.myRecordType(i, i, 'row ' || i, sysdate+i);
end loop;
- simple SELECT from my MASTER-DETAILS joined tables?Hi,
if (row != null)
Row masterRow = row;
vo.setCurrentRow(masterRow);
// not needed : getMesReponsesPourTiersVO1().executeQuery();
You shouldnot execute the child VO after setting current row in master VO.
When the current row is set in master VO, then the child rows will get refreshed automatically.
Cheers,
Prasanna -
How to create a master detail form using single table
Hi,
how to create a master detail form using single table.
Regards,
M. SatishHi
how to create a master detail form using single table.Make the Master ur pks the details the rest of ur data base field in the detail it's a mater of organizing fields on a form M-Detail...
Now What ?
Regards,
Amatu Allah -
Master Detail page. - Create Row.
Hi
I have created a master details search page using the following BC4J objects
EmployeeEO - empId,name,deptno
DepartmentEO - deptno,deptname
EmpToDeptAO - using deptno
EmployeeVO - contains all Attributes of EmployeeEO
DepartmentVO -contaiins all Attribute of DepartmentEO
EmployeeAM contains both VO
The search page is working fine.
In the Search page i have created a create button.When this click this button will be forwarded to create page.
In the create page under the pagelayout region i have two table regions
one Employee Details Entry and the second one deparment details entry.
i have added apply button to the page.
in Process request of controller i have invoked the two create(insert row) methods (one for employeeVO and another for departmentVO)which resides in AM.
in process form request when apply button is pressed, i will commit the details.
Employee details getting committed but department details is not getting committed.Its throwing some exception like the Fonreign Key constraint violated.
but if i give some department no which is already existing in department table region both is getting committed.
How to handle this problem.
how to issue commit separately for master and detail.
Am i clear with the explanation.
Edited by: user10613877 on Dec 13, 2008 9:04 AMI guess you will also need a View Link between the the 2 VOs.
Also the attributes that would be used to join, should be declared as Key Attributes. Here in your case, Dept_Id should be the key Attribute in both the VOs.
You can refer this link.
[master-detail mandatory steps|http://apps2fusion.com/at/ps/333-oa-framework-master-detail-region-mandatory-steps] -
Create Master Detail on a single page
I have a create page with both the master(header) as well as (lines) on the same page.
Here is the page flow:
User navigates to the search screen on which the create button is displayed along with Search/Results regions.
User clicks on create button which takes them to Create Order Page.
The Create Order Page is a master-detail page. I have the create part for the header (which was tested independently before
the details table region is added) working fine which fetches and assigns the headerId from a sequence.
However, when I add the details table region and include the create Row method for the details Row as well , without explicitly
setting the headerId myself and render the page, I get the following exception. This exception is raised as soon as the control reaches the createRow
method of the detail.
This is probably due to the HeaderId being not yet available. How do I get around this issue.
I was initially thinking of setting the attribute myself but the documentation says that when an Composition association
exists between the Entity Objects, OA automatically does it for you.
I included the detailVO in the AM via the view link.
Exception
oracle.apps.fnd.framework.OAException: oracle.jbo.InvalidOwnerException: JBO-25030: Failed to find or invalidate owning entity.
at oracle.apps.fnd.framework.OAException.wrapperException(OAException.java:888)
at oracle.apps.fnd.framework.OAException.wrapperException(OAException.java:862)
at oracle.apps.fnd.framework.OAException.wrapperInvocationTargetException(OAException.java:985)
at oracle.apps.fnd.framework.server.OAUtility.invokeMethod(OAUtility.java:210)
at oracle.apps.fnd.framework.server.OAUtility.invokeMethod(OAUtility.java:152)
at oracle.apps.fnd.framework.server.OAApplicationModuleImpl.invokeMethod(OAApplicationModuleImpl.java:692)
at nih.oracle.apps.po.webui.NihPoStOrdCreateCO.processRequest(NihPoStOrdCreateCO.java:65)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:518)
at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:244)
at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processRequest(OAPageLayoutHelper.java:920)
at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processRequest(OAPageLayoutBean.java:1536)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:866)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:833)After creating your master entity row, use setCurrentRow(<newly created row obj.>)
-
Master-detail UI on single table
Hi,
Iam trying to build a master-detail UI for a denormalized flat interface table. the primary key is a combination of 2 attributes - external reference and reference id that are to be displayed in the master and 1 that is to be displayed in detail - line number. I've ruled out the option of using 2 EOs and 2 VOs because the PK cant be split across 2 tables. i am now considering a solution using a single EO and 2 VOs. Each VO can contain all attributes in the PK apart from those that are displayed in the master/detail table. Furthur a view link on external reference and reference id will acheive the master detail on the UI. However if in the physical table there are 2 records having different line numbers for a system reference and reference id pair then there is the problem of seeing duplicates in the master table of the UI. both the tables on the UI must be editable. Is there a way we could have a master detail UI on a flat table as in this case?
Thanks,
Sushmitha
Edited by: 903697 on Mar 1, 2012 11:32 PM
Edited by: 903697 on Mar 2, 2012 12:46 AMADF Tree with Self Join
http://mohammadjbyaseen.wordpress.com/2012/01/12/implement-herarichy-of-multiple-level-using-one-veiw-object/#comment-13 -
Displaying master/details in a single line by SELECT.
Hello,
In Oracle's typical Order/LineItem example tables, I would like to output the fields of an order followed by fields of all the items for that order in one line in a SELECT statement, without going for PL/SQL coding. All the fields in the output line are comma separated. I guess it can't be done in a SELECT statement. Am I right?
Thanks in advance.Hi,
There might be some mistake in your layout. the print direction should be down.
Look at the below link for more information:
http://oracleapps4u.blogspot.com/2011/03/layout-mode-print-direction.html
Some guide lines in developing the report layout:
http://oracleapps4u.blogspot.com/2011/03/layout-guidelines-to-increase-report.html
If this didnt help you. detail more about your problem -
Master/Detail in create mode with single row insert
Hi,
My jheadstart version is 10.1.3.2.52
I want to insert master and detail together on same page in create mode.
I have these settings:
- Master Layout: Form
- Detail Layout: Table
-"Single-Row Insert Allow" (Checked)
-"Single-Row Update Allow" (Checked)
-"Single-Row Delete Allow" (Checked)
-"Multi-Row Insert Allow" (unchecked)
-"Multi-Row Update Allow" (unchecked)
-"Multi-Row Delete Allow" (unchecked)
-"Show Add Row Button" (Checked)
When I Generate and run Application and click New Button, my detail table don't have any New Button.
Then I set "New Rows" to 1 for detail table and generate and run again, but problem still there!
Can you help me?
ThanksHi,
Thanks for your reply.
But I don't want multi-insert row be enabled(because of some logical reasons that forced by my scenario).
If I enable multi-insert row, even without "new row button" and just set "new row = 1", when user insert first row and click save button, one more empty row automatically add to detail table. I don't want this behavior. I want only one empty row for my detail table in create mode.
thanks again. -
Hi Gurus,
I am trying to implement master-detail report in single window without navigating to other window in OBI 10g by following the below link
http://108obiee.blogspot.in/2010/02/obiee-master-detail-requests-navigation.html
but i am facing problem in creating iframe column and including that column in the report
Can we achieve this requirement in OBI 10g if yes please suggest me how can we do this.
Thanks,Hi Muram,
For implementing Master-detail for the product report when we click on Prod-Cat from master report(Year, Prod-Cat, Tot-Sales) it as to show the detail report (Prod-SubCat,Tot-Sales) in the same window without navigation to the other window for this scenario I implemented the steps as per the below URL which was send in the previous post.
http://obiee10grevisited.blogspot.in/2012/05/master-detailed-report-on-same-page.html
but I am facing problem in 5th,6th,7th steps could you please suggest me on these.
1>First I created master report with columns (Year, Prod-Cat, Tot-Sales)
2>Second I created detail report with columns(Prod-SubCat,Tot-Sales)
3>I have created two prompts Year and Prod-Cat
4>Now in the dashboard page I kept prompts and two reports in separate sections
5>To build intermediate report for validation which columns I have to take in that report and what I have to give in the fx.
6>In the detail report sections in the edit dashboard how to give the reference to the intermediate report and how to make the report not visible at the initial view of the user.
7>In the main report how to give the navigation to the same page which consist of main and detail report together we can navigation either main report or detail report how we can navigation which consist of both.
Thanks,
Rafi
Edited by: Rafi.B on Aug 29, 2012 11:42 AM -
Single-row query return more than one row
Hi all,
Whne i run the following command it is giving me the
The following error has occurred:
Details:
ORA-01427: single-row subquery returns more than one row
UPDATE MRCH.MRC_TEMP_PAY A
SET OFFSET_PH = (SELECT PHASE FROM MRCH.MRC_TEMP_PAY B
WHERE A.PROJECT_ID = B.PROJECT_ID
AND A.MUNI = B.MUNI
AND A.OFFSET = B.NEW_PAY)
WHERE A.PAY_IND = 'Y'
AND OFFSET IS NOT NULL;
any helpI tried max and min
they both give the duplicate row
1 SELECT A.PROJECT_ID,A.PINSUB,
A.MUNI,A.RATED_COST,
A.OLD_COST
FROM MRCH.MRC_TEMP_PAY A
2 WHERE OFFSET_PH = (SELECT max(PHASE) FROM MRCH.MRC_TEMP_PAY B
3 WHERE A.PROJECT_ID = B.PROJECT_ID
4 AND A.MUNI = B.MUNI
5 AND A.OFFSET = B.NEW_PAY
6 )
7 AND A.PAY_IND = 'Y'
8* AND OFFSET IS NOT NULL
SQL> /
PROJEC PIN MUNI RATED_COST OLD_COST
075395 221 070000 159435.45 1062300
175299 399 150000 312397.65 0
175299 399 170000 312397.65 0
SQL> ED
Wrote file afiedt.buf
1 SELECT A.PROJECT_ID,A.PINSUB,
A.MUNI,A.RATED_COST,
A.OLD_COST
FROM MRCH.MRC_TEMP_PAY A
2 WHERE OFFSET_PH = (SELECT mIN(PHASE) FROM MRCH.MRC_TEMP_PAY B
3 WHERE A.PROJECT_ID = B.PROJECT_ID
4 AND A.MUNI = B.MUNI
5 AND A.OFFSET = B.NEW_PAY
6 )
7 AND A.PAY_IND = 'Y'
8* AND OFFSET IS NOT NULL
SQL> /
PROJEC PIN MUNI RATED_COST OLD_COST
075395 221 070000 159435.45 1062300
175299 399 150000 312397.65 0
175299 399 170000 312397.65 0
175315 321 180000 167004.45 1113363
175320 321 130000 273639.45 1824263 -
Create Operation for Master-Detail Relationship Using Composite Association
My requirement is to insert record for both the master and the detail at the same time using a single create insert action.I was successful in doing so using the composite association but when I am trying to commit the new record, I am getting the error that for the primary key Null value cannot be inserted.Then, I made the PK for both the master and detail EO's as DBSequence type which resolved the issue.
My query is , Is there any alternative way to fulfill my requirement by "NOT" using the type for primary key to be DBSequence type?
Thank you for your help.I also want to insert into master detail table in single form but when I insert in master form and then go to detail form for inserting value the master data automatically loss when I press detail create insert button. I am Using Two create insert button one for master and one for detail.
I have also tried this function for solving my problem in other way but the problem is same
public String cb8_action() {
// Add event code here...
BindingContainer bindings =BindingContext.getCurrent().getCurrentBindingsEntry();
//OperationBinding operationBinding = bindings.getOperationBinding("CreateInsert");
//Object result = operationBinding.execute();
OperationBinding operationBinding1 = bindings.getOperationBinding("CreateInsert1");
Object result1 = operationBinding1.execute();
if (!operationBinding1.getErrors().isEmpty()) {
return null;
return null;
Please Help me. -
Multi-row insert in master-detail tables
Hi, I'm using jdev 10.1.3.2 with jheadstart and my problem is:
I hava a master-detail structure, both are tables and my goal is that I want multi insert (exactly 3) in master and detail table when user makes new order(some business scenario). I cannot create rows in master or detail VO by overriding create() method because its entities have complex primary keys and some part of this key is populated by the user with lov. So I set in jhs new rows to 3 and checked multi-row insert allowed but the problem is that overall I can only create rows in master table after I submit form. I want to create row in master table and fill rows in detail table, and after that I want to have opportunity to create second (or even third) row in master table and fill rows in detail table.
thanks for help.
PiotrSee JHS DevGuide: 3.2.1. Review Database Design:
If you are in the position to create or modify the database design, make sure all
tables have a non-updateable primary key, preferably consisting of only one
column. If you have updateable and/or composite primary keys, introduce a
surrogate primary key by adding an ID column that is automatically populated.
See section 3.2.4 Generating Primary Key Values for more info. Although ADF
Business Components can handle composite and updateable primary keys, this
will cause problems in ADF Faces pages. For example, an ADF Faces table
manages its rows using the key of the underlying row. If this key changes,
unexpected behavior can occur in your ADF Faces page. In addition, if you want
to provide a drop down list on a lookup tables to populate a foreign key, the
foreign key can only consists of one column, which in turn means the referenced
table must have a single primary key column.
Groeten,
HJH -
Master-Detail and Auto Insert Detail rows
Apex 3.0
I'm trying to do a Master-Detail form. I have it set to stay on the same page when I Create a new Master Record.
Now, what I would like to do is auto insert data into the Detail Rows some predefined information and have it ready for the user to enter the rest of the information. I did this by creating a Page Process to trigger on the Add Row button for the Details region. The code I used is:
begin
insert into purch_insurance_type (Contract_ID, INSURANCE_TYPE) values(:P7_Contract_ID, 'General');
insert into purch_insurance_type (Contract_ID, INSURANCE_TYPE) values(:P7_Contract_ID, 'Automobile');
insert into purch_insurance_type (Contract_ID, INSURANCE_TYPE) values(:P7_Contract_ID, 'Excess');
insert into purch_insurance_type (Contract_ID, INSURANCE_TYPE) values(:P7_Contract_ID, 'Workers Comp');
insert into purch_insurance_type (Contract_ID, INSURANCE_TYPE) values(:P7_Contract_ID, 'Others (Builders Risk)');
end;
P7_Contract_ID is the PK on the Master table and I predefine the Insurance Type. The rest of the table the user is able to enter as needed.
When I run it, the new rows show up but the Insurance Type is NULL and browsing from one record and back the new rows are gone. It seems like the PK for the Detail rows are not being filled. I have a Sequence Trigger set to fire on Update:
CREATE OR REPLACE TRIGGER "BI_PURCH_INSURANCE_TYPE"
before insert on "PURCH_INSURANCE_TYPE"
for each row
begin
if :NEW."INSURANCE_TYPE_ID" is null then
select "PURCH_INSURANCE_TYPE_SEQ".nextval into :NEW."INSURANCE_TYPE_ID" from dual;
end if;
end;
ALTER TRIGGER "BI_PURCH_INSURANCE_TYPE" ENABLE
What am I missing? Any ideas or suggestions?Hi All!
I think there is no solution to this problem, only single selection is the solution.
If any one has anyother solution plz let me know.
Thanks and regards.
Abbasi -
Master-detail: one detail row with multiple columns
Hi All,
I have a normal master-detail situation in the databse, in the form however all detail rows should be displayed in one single row, using more columns. The number of details are limited, so I can use a predefined number of text-items.
Any ideas on how to implement this?
Regards,
Michielcreate a function that returns your details. e.g. :
function get_detail (P_PK, P_rownum) ...
let's use the example dept and emp. Your master is dept. Your detail is emp. deptno is the PK for the master table.
you have in your form multi-records of dept and maybe 5 items for employees. The name of the text-items TI_data_1 .. TI_data_5. In the post-query-trigger you code :
:DEPT.TI_data_1 := get_detail (:DEPT.DEPTNO, 1);
:DEPT.TI_data_2 := get_detail (:DEPT.DEPTNO, 2);
if you need more columns create a loop and use the built-in COPY for assigning the detail-values to the text-items.
the get_detail e.g. is a select-statement:
SELECT ENAME
FROM EMP
WHERE DEPTNO = P_PK
AND rownum = P_rownum
ORDER BY EMPNO
try it
Gerd -
Insert new row to master - detail form using bindingsource
Hi all,
I have a form to analyse price of product, the form include master (textbox:slip ID,datetimepicker : date) and detail(datagridview:slipID,productID,price..)
When I insert new row as below code, all inserted to DB but not show on form, I must close and reopen the form the new row will show, how i must to do to fix it
please help, thanks
Select data when form load
ds = New DataSet
damaster = New SqlDataAdapter("select soPTG,ngaybd,ngaykt,khoa = case when sttesign =0 then 'True' else 'False' end from tbl_PTGMaster", conn)
damaster.Fill(ds, "tbl_ptgMaster")
dadet = New SqlDataAdapter("select [SoPTG],[Mahang],[gianhap],[thuesuat],[laigop],[giacu],[giamoi] from tbl_PTGDetail", conn)
dadet.Fill(ds, "tbl_ptgdetail")
ds.Relations.Add("PTG_rel", ds.Tables("tbl_ptgmaster").Columns("SoPTG"), ds.Tables("tbl_ptgdetail").Columns("SoPTG")).ChildKeyConstraint.UpdateRule = Rule.Cascade
BindingMaster.DataSource = ds
BindingMaster.DataMember = "tbl_ptgmaster"
BindingDetail.DataSource = BindingMaster
BindingDetail.DataMember = "PTG_rel"
gridchitiet.DataMember = "tbl_ptgdetail"
txtptgnumb.DataBindings.Add("text", BindingMaster, "soPTG")
dtstart.DataBindings.Add("Text", BindingMaster, "ngaybd")
dtend.DataBindings.Add("Text", BindingMaster, "ngaykt")
cmdlock.DataBinding.Add("Enabled", BindingMaster, "khoa", True, DataSourceUpdateMode.OnPropertyChanged)
setStatus()
SetHeader()
Dim cmdinsert As New SqlCommand("insert into tbl_PTGMaster(SoPTG,ngaybd,ngaykt) values(@SoPTG,@ngaybd,@ngaykt)", conn)
cmdinsert.Parameters.Add("@soPTG", SqlDbType.Char, 10).Value = txtptgnumb.Text
cmdinsert.Parameters.Add("@ngaybd", SqlDbType.DateTime).Value = dtstart.Value
cmdinsert.Parameters.Add("@ngaykt", SqlDbType.DateTime).Value = dtend.Value
damaster.InsertCommand = cmdinsert
damaster.FillSchema(ds, SchemaType.Source)
cmdinsert = New SqlCommand("insert into tbl_PTGDetail(SoPTG,mahang,gianhap) values(@SoPTG,@mahang,@gianhap)", conn)
cmdinsert.Parameters.Add("@SoPTG", SqlDbType.Char, 10).Value = txtptgnumb.Text
cmdinsert.Parameters("@SoPTG").Direction = ParameterDirection.InputOutput
cmdinsert.Parameters.Add("@mahang", SqlDbType.Char, 10, "mahang")
cmdinsert.Parameters.Add("@gianhap", SqlDbType.Decimal, 8, "gianhap")
dadet.InsertCommand = cmdinsert
dadet.FillSchema(ds, SchemaType.Source)
gridchitiet.FinishEditing()
BindingMaster.EndEdit()
damaster.Update(ds, "tbl_PTGMaster")
ds.Tables("tbl_PTGMaster").AcceptChanges()
BindingDetail.EndEdit()
dadet.Update(ds, "tbl_PTGDetail")
ds.Tables("tbl_PTGDetail").AcceptChanges()
BindingMaster.ResetBindings(False)
BindingDetail.ResetBindings(False)Hello,
The base idea here is if the record is added successfully you would then get the new primary key then manually add the record to the underlying data source. Does not matter if we are talking a single table or a master-detail setup.
The following shows the basics
https://code.msdn.microsoft.com/Adding-new-records-into-bff5eaaf
All of the above is done without using a DataSet yet the same thing needs to happen with a DataSet, simply focus on the one table.
Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem.
Maybe you are looking for
-
Open/Save as etc Popup windows don't stay open! just close down again
Hey all Ive got a problem on my Macbook Pro, Installed Leopard, and now in most programs whenever I try to bring up the open window or save as etc windows they appear for a second and then closes down again like I have made a selection! Its really an
-
Camera Connector and card reader
When I connect my compact flash card reader through the Camera Connector it immediately recognizes it and when I confirm I wish to load the pictures it will download many of the pictures ... then it just hangs. It can't be a bad jpeg because each tim
-
Problem accessing JDev Generated Web Service on PL/SQL Package
Hi, I'v generated a web service from a pl package using the wizard in JDev for use with Adobe Flex builder. Adobe says they support two types of web services, WSDL 1.1 RPC-Encoded and Document-literal. When I create the web service as Document litera
-
Login wallpaper will not change
Hello, I had until recently been able to use the application Desktop 2 Login to change my login wallpaper. Today I attempted to do so and now I only get the default blue screen. I have attempted using the sudo commands in terminal as well as deleting
-
Uninstall Database manually for Unicode Conversion
Hi Guys, While performing a Unicode Conversion, during Export, Unistall and Import of Database, I would like to improve times for Database Creation since its 5TB My goal is to delete SAP/DB Instance Non-Unicode but keeping Tablespaces and Datafiles L