How to build a query across parent and child object fields?
As a part of an Integration Requirement, I need to query Opportunity records that have been Modified after a specific date and time?
Now, Opportunity has a child object called ProductRevenue with a one to many relationship. Is there anyway I can construct a querypage that will fetch records whose Opportunity fields 'OR' its child ProductRevenue's fields have been modified after a specific date and time?
I have tried using the SearchSpec argument, but it does not let me query across child object fields.
For eg:-
ObjOpptyQueryPageInput.ListOfOpportunity.Opportunity.searchspec = "([ModifiedDate] > '01/01/2013 00:00:00') OR ([ProductRevenueData.ModifiedDate] >= '01/01/2013 00:00:00')";
[This above code written in C# thew me an error saying - The object Opportunity does not have an integration component called - ProductRevenueData.ModifiedDate.]
Any help will be greatly appreciated. Thank you.
Hi,
As far as I know this can't be done at once because you have to consider :
- Every Opportunity and their time-limited ProductRevenues
AND
- Time-limited Opportunities
If you want to achieve this, you have to consider the 2 datasets separately and make your first query :
ObjOpptyQueryPageInput.ListOfOpportunity.Opportunity.searchspec = "([ModifiedDate] >= '01/01/2013 00:00:00')";
but also another query with the restriction on the ProductRevenue Searchspec.
This shouldn't be too hard because the searchspec functionality is present at each level :
- ListOfOpportunity -> Opportunity (the top-level that you used for your query)
- ListOfOpportunity -> Opportunity -> ListOfProductRevenue -> ProductRevenue (the sub-level that you should use for the second query)
Then in your C# code, you merge the 2 datasets and you end up with your expected result.
Hope this helps,
Charles.
http://www.dubant.com
Similar Messages
-
How to use Opendoc to link parent and child
I have parent and child reports, I want to link them. When I click parent id then it should display child report.
How to use Opendoc for this?
Thanks,
CharitaYou can use openDoc selection variable method for link the reports.
Refer this link
http://book.soundonair.ru/sams/ch31lev1sec2.html#PLID2 -
Need query linking parent and child discrete jobs created through ascp planning
Could you help me create a query that will show both the parent and child discrete jobs created through ascp run? I do not need entire query. I need to know the names of tables and understand the links or joins between tables. Then, I shall be able to write the sql on my own.
ThanksJust use a format like this:
http://<Server Name>:<port Number>/OpenDocument/opendoc/openDocument.jsp?sDocName=reportB&sType=wid&sRefresh=Y
&lsMObjectName=[test1],[test2]
Here in lsM[ObjectName] parameter [ObjectName] = the object name which you want to send data to ReportB
I can give you a idea of creating hyperlink for jumping another report (Here ReportB)
Just use a formula like that in any cell:
="<a href=http://<Server Name>:<port Number>/OpenDocument/opendoc/openDocument.jsp?sDocName=reportB&sType=wid&sRefresh=Y&lsMObjectName=[test1],[test2]&sWIndow=New> Click here to view </a>
Now from the property select Read cell content as "Hyperlink"...
thats it......
For more information please see the
"OpenDocument" artile
Hope you can get help from this
Edited by: Arif Arifuzzaman on Aug 20, 2009 7:24 AM -
How to set my vi as Parent and child?
hello ni,
for my application as i want to set my main vi as a parent and sub vi as a child. i mean that if child vi opened and user move that vi, it should not bound above from parent vi, i mean that it should be shown as a with in the parent vi.
and another that i want show the some parametersettings vi, as like that in Visual basic properties tools box, even if i close or open that window, work space vi that should be automatically adjust that size. is it possible with labview?
Regards,
Balaji DPYou mean like Excel?
This is called a Multi Document interface (MDI) and it is possible to set this up with LabVIEW. It is not bug-free!
But at LAVA there is at least one codesnap that provides this info.
Anotherand an XControl base solution
Ton
Message Edited by TCPlomp on 30-05-2010 08:32 AM
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas
LabVIEW, programming like it should be! -
ORACLE SQL Query with Parent and Child structure
I have 2 tables which are Account tbl and Customer tbl, the structure is like below:
Account tbl
Customer_ID Account_ID Parent_Account_ID
3780952 3780952 3780952
3780997 3780997 3780997
3781004 3781004 3780997
Customer tbl (Customer_Group have different value, but im only interest on Personal)
Customer_ID Customer_Group
3781004 Personal
3780997 Personal
3780952 PersonalThe rule to determine PS/NonPS, Principle, Supp as per below:
**PS/NonPs**
Customer_ID equal to Parent_Account and Parent_Account is unique (not exist more than 1) then NonPs.
Customer_ID equal to Parent_Account and Parent_Account is non unique OR - Customer_ID is not equal to Parent_Account then PS
**Principle** IF NonPS then Principle is Null IF PS - If Customer_ID equal to Parent_Account then Principle is Y else N
**Supp** IF NonPS then Supp is Null IF PS - If Customer_ID not equal to Parent_Account then supp is Y else N The final output should be like this
Customer_ID Account_ID Parent_Account_ID PS/NonPS Principle Supp
3780952 3780952 3780952 NonPS Null Null
3780997 3780997 3780997 PS Y N
3781004 3781004 3780997 PS N Y I alredy tried many times but still cant get the output..anyone can help ?hi,
i hope this is what you want , this query matches all of your mentioned requirements .
WITH accounts AS
(SELECT 3780952 AS customer_id, 3780952 AS account_id,
3780952 AS parent_account_id
FROM DUAL
UNION ALL
SELECT 3780997 AS customer_id, 3780997 AS account_id,
3780997 AS parent_account_id
FROM DUAL
UNION ALL
SELECT 3781004 AS customer_id, 3781004 AS account_id,
3780997 AS parent_account_id
FROM DUAL),
customer AS
(SELECT 3781004 AS customer_id, 'Personal' AS customer_group
FROM DUAL
UNION ALL
SELECT 3780997 AS customer_id, 'Personal' AS customer_group
FROM DUAL
UNION ALL
SELECT 3780952 AS customer_id, 'Personal' AS customer_group
FROM DUAL)
SELECT customer_id, account_id, parent_account_id, "PS/NonPS",
CASE
WHEN "PS/NonPS" = 'NonPS'
THEN NULL
WHEN customer_id = parent_account_id
THEN 'Y'
WHEN customer_id <> parent_account_id
THEN 'N'
END principle,
CASE
WHEN "PS/NonPS" = 'NonPS'
THEN NULL
WHEN "PS/NonPS" = 'PS' AND customer_id <> parent_account_id
THEN 'Y'
WHEN "PS/NonPS" = 'PS' AND customer_id = parent_account_id
THEN 'N'
END SUM
FROM (SELECT t1.customer_id, t1.account_id, t1.parent_account_id,
CASE
WHEN t1.customer_id = t1.parent_account_id
AND (SELECT COUNT (*)
FROM accounts
WHERE parent_account_id = t1.parent_account_id) = 1
THEN 'NonPS'
ELSE 'PS'
END "PS/NonPS"
FROM accounts t1, customer t2
WHERE t1.customer_id = t2.customer_id
ORDER BY t1.customer_id)
output
CUSTOMER_ID ACCOUNT_ID PARENT_ACCOUNT_ID PS/NonPS PRINCIPLE SUM
3780952 3780952 3780952 NonPS
3780997 3780997 3780997 PS Y N
3781004 3781004 3780997 PS N YThanks,
P Prakash
Edited by: prakash on Jan 17, 2012 3:38 AM -
How to build a query based on(UNION) 3 vendor InfoObject
Dear Experts:
I have a requirement to build one query based on 3 vendor InfoObjct: 0VENDOR + 0VEN_COMPC + 0VEN_PURORG.
I tried to build a multiprovider upon these 3 infoobjects, but when I Identify(Assign) the key for each InfoObject, supposely there should be 3 InfoObject for me to check (0VENDOR, 0VEN_COMPC and 0VEN_PURORG) so that I can UNION these 3 infoobjects together on vendor number. But since the reference infoobject of these 3 vendor master data is different, I can not check the 3 together.
Can anybody let me know how to build that query? I only need vendor number show once, and the attributes of 0VEN_COMPC and 0VEN_PURORG can be union to 0vENDOR.
Any post would be appreciated and thank you all in advance!
Best Regards!
TimHi,
you can create a link between the vendor objects itself, means link 0vendor with 0ven_compc and 0ven_purorg. This should give you a list of all vendors multiplied with the comp codes multiplied with the purch. org. May be here it is possible to create another link between a attribute (eg. comp_code of 0ven_purorg with comp_code of 0ven_compc). In case it is not possible you need to add this link information somehow. Another option might be to create 2 queries. One on a infoset of 0vendor and 0ven_purorg and another one on 0vendor and 0ven_compc.
regards
Siggi -
How to build a query to join on two tables without mapping
I did Automatic mapping by the workbench Directofield mapping with the table and java object.
Wanted to build a simple join query by joining on the same field on both the tables.Not the sql query through the toplink using expression builder.
Please help.............
Spent one full day for this................Thanks Don for the reply,sorry to bug you,but i need help.....
SELECT A.AGNCY_C,
A.TYPE_C,
A.RESN_C,
A.S_TYPE_C,
A.SUB_ID_C,
A.RY_C
FROM RATING A, REF B
WHERE A.ID_C = B._ID_C
AND A.ALPHA_C = B.ALPHA_C
AND A.EFF_D >= B.MATURITY_D
This is the real query i was talking about.I did mapping automatically through the workbench,generated java classes also throught the workbench.
Now they don't want to execute the raw sql.They wanted to get all the RATING objects with the where condition.
So how to build a query by using toplink.
tried your example
ExpressionBuilder builder = new ExpressionBuilder();
Expression creditRating = builder.getTable("RATING").getField("ID_C");
Expression issue_ref = builder.getTable("REF").getField("ID_C");
Expression join = creditRating.equal(issue_ref);
I am getting java.lang.OutOfMemoryError
error.
I selected the option generate classes and descriptors
from the tables (RATING,REF).,so it created the classes and dscriptors automatically.
In Database script for the table RATING like this
ALTER TABLE RATING ADD (
CONSTRAINT RATING_F1 FOREIGN KEY (ID_C, ALPHA_C)
REFERENCES REF (ID_C,ALPHA_C));
I think when i generate descriptor automatically it is keeping this association.
Please help me......... -
How to build a query dynamically....
hi...i want to build a query dynamically. i don't want to build query by using string buffer. i want to create it directly by using sql query itself.
my situation is like this....i have four drop down list in a page. The user can search the things based on one or two or three or four selected values.
how to build a query for this kind of situation....pls let me know.
Edited by: success_shiva6mca on Mar 3, 2008 12:39 PMthere are two problems with building sql directly.
1. it allows sql injection
2.it allows XSS
google them and you will understand if you dont already.
I will recoment catching the values and using preparedStatements -
Delivery document how to print the BOM Parent and Child items
Hi,
I have a production BOM. In Delivery document how to print the Parent and Child items Item Code and Qty.At the time
of add a delivery document Inventory stock redused only in Parent Item not child item because child item stock already reduced in issue for production.If you need to print both the BOM Parent and Child items, you have to create your own report. BOM is only for production if it is not Sales type.
Thanks,
Gordon -
How to build the FM data I_header and I_orgdata
hi all,
Im working on the conversion program for AVL using the following function modules
BBP_PD_AVL_GETLIST
BBP_PD_AVL_CREATE
BBP_PD_AVL_UPDATE
BBP_PD_AVL_SAVE
In the function module BBP_PD_AVL_CREATE , how to build the FM data I_HEADER and I_ORGDATA.
I'm giving 3 input in Export parameter in BBP_PD_AVL_GETLIST and E_pdlist should contain data .
but e_pdlist is not getting data...any suggestion..
after execution it was showing "Buffer table is not up to date"
with regards,
P.lokeshHi Lokesh,
We are also encountering same problem.
How did you solve your problem?
Would really appreciate your help.
Thanks,
Kezia -
How to link parent and child relation in Metapedia
How to link parent and child relation in Metapedia
Vamsi,
Did you every determine how to do what you were asking about? Where you thinking of how to link a parent term to a child term (i.e. like a related term) or was this about linking a term to a different metadata object (e.g. table or report) ? -
How to differentiate between Parent and Child in IBASE?
Hi. I am working on enhancing a BAPI :BAPI_GOODSMVT_CREATE by calling the following function module IBPP_CREATE_IBASE at its exit.
The BAPI is being called from an SAP ME system and will be passing MATNR and Serial Number of Parent and Child materials to create the IBASE in ECC system. I am confused as to how to differentiate between whether a object is Parent or a Child when the BAPI: BAPI_GOODSMVT_CREATE is called.if you have NULL valued fields. If
you do a compare and one or both are NULL, then the result is always NULL,
never true or false. Even comparing two fields which are both NULL will
give NULL as result, not true! Or if you have something like "select
sum(field) from ..." and one or more are NULL, then the result will be
NULL. Use always "if field is NULL ..." for NULL checking and for safety
maybe something like "select sum( IsNull(field,0) ) from ...". Check the
function ISNULL() in the manual. -
Query to delete both parent and child record....
hai.........
I tried to delete a record from the table.... but i get a error saying 'child record' exist cannot delete record'.... can u plz tell me the query to delete both parent and child record....
plz help me.....
anoo...Hello,
Is already answered in {thread:id=824593}. Please mark the question as answered.
Greetings,
Roel
http://roelhartman.blogspot.com/
http://www.bloggingaboutoracle.org/
http://www.logica.com/ -
Need query to link parent and child discrete job planned through ascp
Could you help me create a query that will show both the parent and child discrete jobs created through ascp run? I do not need entire query. I need to know the names of tables and understand the links or joins between tables. Then, I shall be able to write the sql on my own.
ThanksHi;
Please check below thread which could be helpful for your issue:
http://forums.oracle.com/forums/thread.jspa?messageID=9155702
Regard
Helios -
Hierarchy query showing parent and their child records
I'm a newbie on Oracle using Tora,
I'm Trying to run a query that will show me a hierarchical view of parent and child records in a table.
So far I"ve found a query format like this, but its not working
SELECT employee_id, last_name, manager_id
FROM employees
CONNECT BY PRIOR employee_id = manager_id;
but when running it with my tables and columns I get an error message
saying something 'cannont run CONNECT BY in subquery'
Any ideas?Thanks for all the help, I'm getting the error message
'ORA-01473: cannot have subqueries in CONNECT BY clause'
Here's my actual query
select resource_id, lname, org_id
from std_resource
start with resource_id = 413783
connect by prior resource_id = org_id;
I'm trying to display a hierarchical list of user resource_id's, last names, and org_id's from the std_resource table starting withe resource_id 413783
Maybe you are looking for
-
In Infoprovider DSO no query fields available ( 0PM_DS02_Q0001 )
Hi, I have a problem in Quality Managemenr (QM) module query called ( Mean Time To Repair (MTTR) and Mean Time Between Repair ) 0PM_DS02_Q0001 and this query 0PM_DS02 which loads the data from 0PM_DS01 data mart. in the query key figures are MTTR
-
How do you change the MTU size in a Cisco 871?
This 871 is at a remote site and is an ezvpn IPsec client (network extension mode) back to a 3030 headend. We're having problems with a PC trying to connect through the IPsec tunnel and we think it may be an MTU size problem. Int F4 is the outside in
-
Design Mode not working - java.lang.Null Pointer exception
When attempting to use the Design mode Flash Builder has started to completely fail to display the design and issues following erros in the components tab: "Could not create the view: An unexpected exception was thrown." "java.lang.NullPointerExcepti
-
Java Service Launcher Problems
I am trying to get a java application running as a windows service. I have been using java service launcher because it is free and am unable to get the program running. It installs the service fine and if I run jsl -debug or jsl -run then the app exe
-
IPod fifth Generation connection problem
Hi My teacher has a fifth gen ipod and she got the brand new itunes update on her PC and now when she plugs it into her ipods dock, windows does not see the ipod at all, but the ipod says "Do Not Disconnect" Please Help!