How do I create both rows in a 1-1 relationship?
Hi Guys and Gals,
I've been confused by this for quite a while now.
I have three Entities with the following relationships:
Master (1-*) Order as a Composition Association.
JounalEntry (0..1 - 1) Order
How do I create a row in all three entities, preferably by overriding or creating new EntityImpl methods? I would rather not do this in a View Object.
First, I create a row in Master. Then I get the Master->Order RowSet and insert a row into Order. From Order, how do I also create a row in JournalEntry?
Can anyone point me in the right direction? I've tried quite a few different ideas but keep getting null pointer exceptions.
Using JDev 11.1.2.1.0.
Will
Another way to phrase this question is
How do I create a child row that has two parents?
So Imagine the relationships like so...
Master (1-*) Order
JournalEntry (1-*) Order
The only way I know how to do this is via the AppModuleImpl. However, EVERY time I create a Master row, there will also be a Journal Entry. Therefore, I would like to include this in Master's EntityImpl create method somehow.
Similar Messages
-
How do I create both endnotes and footnotes in same doc in Pages? I have iWork 2008. I understand how to create one or the other, but not both.
You have to select one or the other.
Try making two documents and see if you can merge the .pdfs, but their will be problems with page flow, making the pages shift. Can't see it working really.
Pages is not the only solution out there or the best for most jobs (let alone the safest). Try Word for Mac, LibreOffice (free) or any App that has the features you need.
Peter -
How do I create both a landscape and portrait display for my landing page?
I am using dreamweaver with phonegap to create an app.
I want to have two options for the landing page; one optimized for portrait, one optimized for landscape, that will change based on device orientation.
How do I do this?
Thank youHave a look at this article http://voormedia.com/blog/2012/11/responsive-background-images-with-fixed-or-fluid-aspect- ratios
-
Question: How to dynamically create multiple rows in a table together
I'm sure this is obvious to a seasoned person but I'm a newbie (just working with Forms for 1 week).
In the snapshot below I'm trying when I hit the Add button I'd like the two rows below the header in the table to replicate themselves below in the table.
Eventually there will be many rows to replicate. The problem is that I can't find a way to group these and then reference them by the javascript in the "add button" so that they replicate together.
any help/pointers etc. are much appreciated.
ThxYou can only add 1 row at a time .....so if you want to add three rows then you would have to run the command three times.
Make sense?
Paul -
Oracle 9i.
How can i create dummy rows?
My table consist of job, job_type and many numeric fields.
The max of Job_type is 9 for 1 job.
Not all job(s) have all job_types.
If a job_type is missing, I have to create a dummy record with all numeric fields = 0.
Thanks,
Ivan.How about this:
CREATE TABLE jobs
Job number,
type varchar2(1),
fld1 number,
fld2 number,
fld3 number
INSERT INTO jobs VALUES (1, 'a', 12, 13, 32);
INSERT INTO jobs VALUES (1, 'b', 11, 22, 22);
INSERT INTO jobs VALUES (1, 'c', 22, 33, 33);
INSERT INTO jobs VALUES (1, 'd', 12, 12, 12);
INSERT INTO jobs VALUES (2, 'a', 12, 23, 33);
INSERT INTO jobs VALUES (2, 'c', 12, 34, 34);
commit;
JOB T FLD1 FLD2 FLD3
1 a 12 13 32
1 b 11 22 22
1 c 22 33 33
1 d 12 12 12
2 a 12 23 33
2 c 12 34 34
MERGE INTO jobs j
USING
SELECT j.job,
jt.type
FROM (
SELECT DISTINCT job
FROM jobs
) j,
SELECT chr(96+LEVEL)type
FROM dual
CONNECT BY LEVEL <10
) jt
) source_data
ON (j.job = source_data.job AND
j.type = source_data.type)
WHEN NOT MATCHED THEN INSERT
job,
type,
fld1,
fld2,
fld3
VALUES
source_data.job,
source_data.type,
0,
0,
0
SELECT job, type, fld1, fld2, fld3
FROM jobs
ORDER BY job, type;
JOB T FLD1 FLD2 FLD3
1 a 12 13 32
1 b 11 22 22
1 c 22 33 33
1 d 12 12 12
1 e 0 0 0
1 f 0 0 0
1 g 0 0 0
1 h 0 0 0
1 i 0 0 0
2 a 12 23 33
2 b 0 0 0
2 c 12 34 34
2 d 0 0 0
2 e 0 0 0
2 f 0 0 0
2 g 0 0 0
2 h 0 0 0
2 i 0 0 0Or this:
INSERT INTO jobs
job,
type,
fld1,
fld2,
fld3
SELECT j.job,
jt.type,
0,0,0
FROM (
SELECT DISTINCT job
FROM jobs
) j,
SELECT chr(96+LEVEL)type
FROM dual
CONNECT BY LEVEL <10
) jt
MINUS
SELECT job,
type,
0,0,0
FROM jobs; Greg Pike
http://www.singlequery.com -
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. -
How can I create an empty row on a #TempTable based on an input parameter
So if my Line of Business is 'MC' or 'MG', I have to go over to Oracle and get its data accordingly. Then, when I create my final report result set, I think I'll want to UNION in that result set if my Parameter is 'MC' or 'MG'. I don't think I can UNION
based on the value of the Parameter. So my thought process was to create an empty row on my #TempTable so when I UNION and my parameter is NOT 'MC' or 'MG' then it will have nothing to UNION in. My struggle is how do I create an empty row in my #TempTable
if my parameter is NOT 'MC' or 'MG'
If I am wwwaaayyy off here, please tell me so.
This is my #TempTable Creation SQL...
IF EXISTS
(SELECT 1
FROM [#TempTable_LineOfBusiness_Parameter]
WHERE [#TempTable_LineOfBusiness_Parameter].[RESULT] IN ('MC','MG'))
BEGIN
SELECT *
INTO [#TempTable_Market_Prominence_Member_Data]
FROM OPENQUERY
(RPDMHF,
'SELECT HCFA_NAME_ORG.NAME_ID,
HCFA_NAME_ORG.MEMBER_ID,
HCFA_NAME_ORG.HIC_NUMBER,
MEMBER.NAME_FIRST,
MEMBER.NAME_LAST,
HCFA_DATE.START_DATE,
HCFA_DATE.END_DATE,
HCFA_NAME_ORG.COUNTY_CODE,
HCFA_NAME_ORG.PART_A_PAYMENT,
HCFA_NAME_ORG.PART_B_PAYMENT,
HCFA_NAME_ORG.STATUS,
HCFA_NAME_ORG.ORG_ID,
HCFA_NAME_ORG.PLAN,
HCFA_NAME_ORG.ENROLL_DATE,
HCFA_NAME_ORG.PBP_ID,
HCFA_DATE.VALUE
FROM SC_BASE.HCFA_DATE
LEFT JOIN SC_BASE.HCFA_NAME_ORG
ON HCFA_NAME_ORG.NAME_ID = HCFA_DATE.NAME_ID
LEFT JOIN AMIOWN.MEMBER
ON TRIM(MEMBER.MEMBER_NBR) = TRIM(HCFA_NAME_ORG.MEMBER_ID)
WHERE HCFA_DATE.INDICATOR = ''plan''
AND HCFA_DATE.START_DATE >= ''2015-01-01''
END
If I add an ELSE, it always comes back and tells me the #TempTable_Market_Prominence_Member_Data already exists. As if it's creating it regardless of the Top IF.
Thanks for your review and am hopeful for a reply.Hi ITBobbyP,
The error came back from your ELSE Statement most probably caused by the reason mentioned in Hoffmann's post.
Regarding your requirement, I would suggest you CREATE the [#TempTable_Market_Prominence_Member_Data] explicitly.
CREATE TABLE [#TempTable_Market_Prominence_Member_Data]
NAME_ID INT,
MEMBER_ID INT,
HIC_NUMBER VARCHAR(99),
NAME_FIRST VARCHAR(99),
NAME_LAST VARCHAR(99),
START_DATE DATE,
END_DATE DATE,
COUNTY_CODE VARCHAR(99),
PART_A_PAYMENT MONEY,
PART_B_PAYMENT MONEY,
STATUS VARCHAR(99),
ORG_ID INT,
PALN VARCHAR(99),
ENROLL_DATE VARCHAR(99),
PBP_ID INT,
VALUE INT
IF EXISTS
(SELECT 1
FROM [#TempTable_LineOfBusiness_Parameter]
WHERE [#TempTable_LineOfBusiness_Parameter].[RESULT] IN ('MC','MG'))
BEGIN
INSERT INTO [#TempTable_Market_Prominence_Member_Data]
SELECT *
FROM OPENQUERY
(RPDMHF,
'SELECT HCFA_NAME_ORG.NAME_ID,
HCFA_NAME_ORG.MEMBER_ID,
HCFA_NAME_ORG.HIC_NUMBER,
MEMBER.NAME_FIRST,
MEMBER.NAME_LAST,
HCFA_DATE.START_DATE,
HCFA_DATE.END_DATE,
HCFA_NAME_ORG.COUNTY_CODE,
HCFA_NAME_ORG.PART_A_PAYMENT,
HCFA_NAME_ORG.PART_B_PAYMENT,
HCFA_NAME_ORG.STATUS,
HCFA_NAME_ORG.ORG_ID,
HCFA_NAME_ORG.PLAN,
HCFA_NAME_ORG.ENROLL_DATE,
HCFA_NAME_ORG.PBP_ID,
HCFA_DATE.VALUE
FROM SC_BASE.HCFA_DATE
LEFT JOIN SC_BASE.HCFA_NAME_ORG
ON HCFA_NAME_ORG.NAME_ID = HCFA_DATE.NAME_ID
LEFT JOIN AMIOWN.MEMBER
ON TRIM(MEMBER.MEMBER_NBR) = TRIM(HCFA_NAME_ORG.MEMBER_ID)
WHERE HCFA_DATE.INDICATOR = ''plan''
AND HCFA_DATE.START_DATE >= ''2015-01-01''
END
Explicitly creating the temp table will offer below benefit in this case.
The ELSE statement is no longer needed, if the no rows get inserted into that table, it has nothing to union an empty table.
With the column datatype defined, you can avoid such conversion error
SELECT NULL AS COL1,NULL AS COL2 INTO #T
SELECT COL1,COL2 FROM #T
UNION
SELECT 1,'ABC'--Conversion failed when converting the varchar value 'ABC' to data type int.
If you have any question, feel free to let me know.
Eric Zhang
TechNet Community Support -
The attached file is work inprogress, with some dummy data sp that I can test it out without having to connect to equipment.
The second tab is the one that I am having the problem with. the output array from the replace element appears to be starting at the index position of 1 rather than 0 but that is ok it is still show that the new data is placed in incrementing element locations. However the main array that I am trying to build that is suppose to take each new calculation and place it in the next index(row) does not ap
pear to be working or at least I am not getting any indication on the inidcator.
Basically what I am attempting to do is is gather some pulses from adevice for a minute, place the results for a calculation, so that it displays then do the same again the next minute, but put these result in the next row and so on until the specifiied time has expired and the loop exits. I need to have all results displayed and keep building the array(display until, the end of the test)Eventually I will have to include a min max section that displays the min and max values calculated, but that should be easy with the min max function.Actually I thought this should have been easy but, I gues I can not see the forest through the trees. Can any one help to slear this up for me.
Attachments:
regulation_tester_7_loops.vi 244 KBI didn't really have time to dig in and understand your program in depth,
but I have a few tips for you that might things a bit easier:
- You use local variables excessively which really complicates things. Try
not to use them and it will make your life easier.
- If you flowchart the design (very similar to a dataflow diagram, keep in
mind!) you want to gather data, calculate a value from that data, store the
calculation in an array, and loop while the time is in a certain range. So
theres really not much need for a sequence as long as you get rid of the
local variables (sequences also complicate things)
- You loop again if timepassed+1 is still less than some constant. Rather
than messing with locals it seems so much easier to use a shiftregister (if
absolutely necessary) or in this case base it upon the number of iterations
of the loop. In this case it looks like "time passed" is the same thing as
the number of loop iterations, but I didn't check closely. There's an i
terminal in your whileloop to read for the number of iterations.
- After having simplified your design by eliminating unnecessary sequence
and local variables, you should be able to draw out the labview diagram.
Don't try to use the "insert into array" vis since theres no need. Each
iteration of your loop calculates a number which goes into the next position
of the array right? Pass your result outside the loop, and enable indexing
on the terminal so Labview automatically generates the array for you. If
your calculation is a function of previous data, then use a shift register
to keep previous values around.
I wish you luck. Post again if you have any questions. Without a more
detailed understanding of your task at hand it's kind of hard to post actual
code suggestions for you.
-joey
"nelsons" wrote in message
news:[email protected]...
> how do I create a 1d array that takes a single calculation and insert
> the result into the first row and then the next calculation the next
> time the loop passes that point and puts the results in thsecond row
> and so on until the loop is exited.
>
> The attached file is work inprogress, with some dummy data sp that I
> can test it out without having to connect to equipment.
> The second tab is the one that I am having the problem with. the
> output array from the replace element appears to be starting at the
> index position of 1 rather than 0 but that is ok it is still show that
> the new data is placed in incrementing element locations. However the
> main array that I am trying to build that is suppose to take each new
> calculation and place it in the next index(row) does not appear to be
> working or at least I am not getting any indication on the inidcator.
>
> Basically what I am attempting to do is is gather some pulses from
> adevice for a minute, place the results for a calculation, so that it
> displays then do the same again the next minute, but put these result
> in the next row and so on until the specifiied time has expired and
> the loop exits. I need to have all results displayed and keep building
> the array(display until, the end of the test)Eventually I will have to
> include a min max section that displays the min and max values
> calculated, but that should be easy with the min max function.Actually
> I thought this should have been easy but, I gues I can not see the
> forest through the trees. Can any one help to slear this up for me. -
How can I create an iCloud account if I have iTunes on my PCs (both desktop & laptop) but have no other iOS device?
http://https://ci6.googleusercontent.com/proxy/0pvg0cE2YuFQ5ZaqwDNORf8TKnYmWkUdN BSVpRgn2lNMR_03qYeKN64jE6LXbMOJBBCc7agiJIAYFvS28j7y-UiLaBMdhM2t7I79q8mQsl5T5aMj7 dBPHFU2Za204sZnDh5muA=s0-d-e1-ft#http://ax.phobos.apple.com.edgesuite.net/email/ images_shared/spacer_999999.gif
-
How To Create Multi Row Edit Forms in a JSP
Hi, Could someone tell me how can i create multi edit rows in BC4J JSP edit page.
Thanks
SirishaRefer to
BC4J Multi-Row Extension API which provides multiple row operations to BC4J-based web application.
http://sourceforge.net/docman/display_doc.php?docid=19393&group_id=87369
http://radio.weblogs.com/0118231/2005/04/20.html#a529 -
How to create multiple rows in a child table from the multi select Lov
Hi
We have Departments and EmployDept and Persons tables and each employee can associate multiple departments and vice versa.While creating a Department page there should be a Multi Select LOV(values from Persons table) with search option for the Persons.From the search panel we can select multiple persons for that department.Suppose we have selected 5 persons and click on submit, then it should create 5 rows in the EmployDept table for 5 persons with that department id.
Any inputs on how to implement this scenario please..Maybe you can get some ideas from here -
http://adfdeveloper.blogspot.com/2011/07/simple-implementation-of-af.html -
How can i create a grid with summary row
Hello Professionals,
I'm wondering how could i create a grid like the grid below, i want to create a grid with summary row,
i have tried to create it using collapsing but it didn't work as required.
Any suggestions?, i want to know just the starting point so i can make deep investigations.
Thanks in Advance,Hi Karem,
this can be achieved by just assigning a datatable containing the data plus some formatting of grid. Meaning there is no feature for that.
The datatable can be filled manually or by sql query. Then you have to attach some events for updating the values ( validate after for gid item ).
A small example for a sql query showing last month quotations and orders with summary :
select 1 as Sort,cast(DocNum as varchar) as DocNum,DocTotal,convert(varchar, DocDate,104) from OQUT where DocDate between DATEADD(month, -1, GETDATE()) AND GETDATE()
UNION ALL
Select 2 as Sort,'Summary ( Quotation ) : ',sum(DocTotal), convert(varchar, DATEADD(month, -1, GETDATE()),104)+' - '+convert(varchar, GETDATE(),104) from OQUT where DocDate between DATEADD(month, -1, GETDATE()) AND GETDATE()
UNION ALL
select 3 as Sort,cast(DocNum as varchar) as DocNum,DocTotal,convert(varchar, DocDate,104) from ORDR where DocDate between DATEADD(month, -1, GETDATE()) AND GETDATE()
UNION ALL
Select 4 as Sort,'Summary ( Order ) : ',sum(DocTotal), convert(varchar, DATEADD(month, -1, GETDATE()),104)+' - '+convert(varchar, GETDATE(),104) from ORDR where DocDate between DATEADD(month, -1, GETDATE()) AND GETDATE()
ORDER by Sort
regards,
Maik -
How to create a Row in a table in SMARTFORMS
Dear All,
I'm working with SAP 4.6C.
I have created a table under the Main Window. After that I have activated the Heade and Footer Check Box in the EVENT TAB of the TABLE. But, Main Area option is not there.
Because of that it is displaying the TABLE Node like
TABLE
Header
Footer
Not Like
TABLE
Header
Main Area
Footer
Under the Header I want to create a row. After creating the row only I can create the cells.
I have defined the line type as %LTYPE1. Even though it is not dispalying the ROW under Header
It should display
TABLE
Header
Row
Cell1
Text1
Cell2
Text2
Main Area
Footer
But, it is not displaying the ROW after creating the line type .
How to overcome this problem...
<<Text removed by moderator>>
Regards,
Bhaskar
Edited by: Matt on Feb 28, 2009 7:02 PM - Please do not offer rewards or pointsHello,
u have posted this question 2 times
When you work on a table node in your form, the node is marked with the table icon . In the
maintenance frame, you get a new type of tab, the Table tab. See below.
On this tab, you can define the table characteristics, and turn on the Table Painter to help lay out
the rows and columns. Turn on the Table Painter by choosing-> Table Painter.
May this link helps u
http://www.scribd.com/doc/7375795/Smart-Form
Thank u,
santhosh -
How to create dublicate row in af:table ?
Hi All,
In my use case i have to add one custom button name as duplicate just above of af:table where user have option to click that button to create a row in table which contains duplicate value of the current row.
How would i achieved this scenario
Please let me know
Thanks
Edited by: ADFORCLE on Jan 16, 2012 6:48 PMTake a look at the blog post which provides the solution for the use-case:
http://www.adftips.com/2010/10/adf-model-creating-duplicate-row.html
Thanks,
Navaneeth -
How to Commit before Insert Row when Press Create Insert Button ?
Hi all;
I'm Using JDev 11.1.1.2.0
How to Commit before Insert Row when Press Create Insert Button in ADF11g?
<af:commandButton actionListener="#{bindings.CreateInsert.execute}"
text="CreateInsert"
disabled="#{!bindings.CreateInsert.enabled}"
id="cb8" />
best regards;You need to do a custom method eather in managed bean or in Application module to do that.
in managed bean it would be something like:
public void CommitAndInsert(ActionEvent actionEvent) {
OperationBinding opCommit = ADFUtils.findOperation("Commit");
opCommit.execute();
OperationBinding opCreateInsert = ADFUtils.findOperation("CreateInsert");
opCreateInsert.execute();
In page bindings Commit and CreateInsert must exist
then the button actionListener will be
<af:commandButton actionListener="#{backing.CommitAndInsert}"
Maybe you are looking for
-
Why is repair of file permissions not automatic if it is so important?
Over an over I have seen advice to use Disk Utility to verify and repair permissions to prevent or to try to repair OS problems. Some say repair weekly, some monthly, other say after updates, others when there are problems and on and on and on. If th
-
Autosave functionality in peoplesoft
hi, i've placed an autosave code (which i've got in the internet) in an HTML area (property is constant) then when I access the page where the code has been included, I've encountered an IE error which states: Char: 41 Error: Expected '{' here's the
-
ive not been able to access bbm or emails for over 3 days now and my phone keeps reseting itself, any ideas ????? blackberrys are rubbish, never again
-
My MacBook Pro (late 2011, core i-7) running OS X 10.10.4 is running hot and very slow with the fan screaming . Activity Monitor shows a process called com.hp.devicemodel.TransportProxy is hogging almost all the memory and very high CPU activity. H
-
Applet Won't work out of NetBeans W/Swing
My Applet is working in NetBeans sun AppletRunner, but won't run in a browser and gives this exception: java.lang.NoClassDefFoundError: org/jdesktop/layout/GroupLayout$Group at java.lang.Class.getDeclaredConstructors0(Native Method) at java