Combining two programs to make one
Is there an easy way for me to combine these two programs? What I am wanting to use an array for the different loans. Display the mortgage payment amount for each loan and then list the loan balance and interest paid for each payment over the term of the loan. Use loops to prevent lists from scrolling off the screen. Here are the two programs I have so far. Any guidance is appreciated.
import java.io.*; // java input output package
import java.text.DecimalFormat; // allows placement of decimal
public class MonthlyPayments4e extends Thread //class header with "Thread" for sleep
public static void main(String[] args)
double Loan, NewBal, MIP;
double Rate, MonthlyInterest, Payments; //double precision variables
//assign values to variables
Loan= 200000; // loan amount
Rate = .0575; //interest rate
MonthlyInterest = Rate / 12; // interest for each month
Payments = Loan * (MonthlyInterest / (1 - Math.pow(1+MonthlyInterest, -360))); //my formula
DecimalFormat twoDigits = new DecimalFormat("$,000.00"); // declares decimal format
MIP= (Loan * Rate) / 12;
NewBal = Loan -(Payments-MIP);
System.out.println("Monthly Payments Interest Paid This Payment Loan Balance");
System.out.println();//my printout provides extra line
System.out.print(" " + twoDigits.format(Payments)); //my printout
System.out.print("\t\t\t" + twoDigits.format(MIP));//my printout
System.out.println("\t\t\t" + twoDigits.format(NewBal));//my printout
System.out.print(" " + twoDigits.format(Payments)); //my printout
MIP=(NewBal*Rate)/12;
System.out.print("\t\t\t" + twoDigits.format(MIP));//my printout
NewBal=NewBal -(Payments-MIP);
System.out.println("\t\t\t" + twoDigits.format(NewBal));//my printout
System.out.print(" " + twoDigits.format(Payments)); //my printout
while (NewBal > 1) //while loop to make computations continue until gets to $200000
MIP=(NewBal*Rate)/12;
System.out.print("\t\t\t" + twoDigits.format(MIP));//my printout
NewBal=NewBal -(Payments-MIP);
System.out.println("\t\t\t" + twoDigits.format(NewBal));//my printout
System.out.print(" " + twoDigits.format(Payments)); //my printout
if (NewBal <100000) // tells when this is met to transition to sleep phase
try
Thread.sleep (500); //sleep phase needed per change request also states pause is 500 milliseconds
catch (InterruptedException e)
import java.io.*; // java input output package
import java.text.DecimalFormat;
public class MonthlyPayments5 //class header
public static void main(String[] args) //don't know if this is needed or not but here it is
double Loan;
double Rate1,Rate2,Rate3, MonthlyInterest1,MonthlyInterest2,MonthlyInterest3,Payment1,Payment2,Payment3; //double precision variables
//assign values to variables
Loan= 200000; // loan amount
Rate1 = 5.75;
Rate2 = 5.5;
Rate3 = 5.35;
MonthlyInterest1 = (Rate1 / 100) / 12;
MonthlyInterest2 = (Rate2 / 100) / 12;
MonthlyInterest3 = (Rate3 / 100) / 12;
Payment1 = Loan * (MonthlyInterest1 / (1 - Math.pow(1+MonthlyInterest1, -360))); //my formula
Payment2 = Loan * (MonthlyInterest2 / (1 - Math.pow(1+MonthlyInterest2, -180))); //my formula
Payment3 = Loan * (MonthlyInterest3 / (1 - Math.pow(1+MonthlyInterest3, -84))); //my formula
DecimalFormat twoDigits = new DecimalFormat("000.00");
System.out.println("\tYour Monthly Payments for 30 years are:\t $" + twoDigits.format(Payment1)); //my printout
System.out.println("\tYour Monthly Payments for 15 years are:\t $" + twoDigits.format(Payment2)); //my printout
System.out.println("\tYour Monthly Payments for 7 years are:\t $" + twoDigits.format(Payment3)); //my printout
Any guidance is appreciated. Here's some guidance:
ublic class MonthlyPayments4e extends Thread //class
header with "Thread" for sleepThere's no need for your class to extend Thread. If it truly needs to run in a separate thread, better to implement Runnable.
public static void main(String[] args)
{It's a common newbie mistake to put lots of code into main methods. After all, that's what you "run", right? Better to put that code into a class or instance method that you have a main method call. Other objects can get at it that way.
double Loan, NewBal, MIP;
double Rate, MonthlyInterest, Payments; //double
precision variablesLearn and follow the Sun Java coding standards:
http://java.sun.com/docs/codeconv/
This isn't VB.
The comment "// double precision variables" is totally, utterly useless. The fact that they're declared as double is more than sufficient. Useless comments like these just clutter up code.
//assign values to variablesMORE useless comments! Get rid of them. You've probably been taught that comments are good. I'm here to tell you that comments are bad. Write your code clearly enough and you won't need comments. Good choices for variable and method names and good refactoring are worth a million comments.
oan= 200000; // loan amount
Rate = .0575; //interest rate
MonthlyInterest = Rate / 12; // interest for each
monthThe principal, interest rate, and term length should all be input values to your method, not hardwired like this. If you're asked to change the rate or principal you have to recompile your code. Terrible.
Payments = Loan * (MonthlyInterest / (1 -
Math.pow(1+MonthlyInterest, -360))); //my formulaSeparate the calculation from the display.
DecimalFormat twoDigits = new
DecimalFormat("$,000.00"); // declares decimalUse a currency formatter. Your program should not care if it's USD or euros or some other currency. Let the default Locale figure out what the currency format should be.
format
MIP= (Loan * Rate) / 12;
NewBal = Loan -(Payments-MIP);
System.out.println("Monthly Payments Interest Paid
This Payment Loan Balance");Do the calculation in the method and let something else print out values.
System.out.println();//my printout provides extra
line
System.out.print(" " +
twoDigits.format(Payments)); //my printout
System.out.print("\t\t\t" +
twoDigits.format(MIP));//my printout
System.out.println("\t\t\t" +
twoDigits.format(NewBal));//my printout
System.out.print(" " +
twoDigits.format(Payments)); //my printout
MIP=(NewBal*Rate)/12;
System.out.print("\t\t\t" +
twoDigits.format(MIP));//my printout
NewBal=NewBal -(Payments-MIP);
System.out.println("\t\t\t" +
twoDigits.format(NewBal));//my printout
System.out.print(" " +
twoDigits.format(Payments)); //my printout
Why $200000? What if I wanted to calculate payments on $1M USD? Or 2B yen?
while (NewBal > 1) //while loop to make computations
continue until gets to $200000
MIP=(NewBal*Rate)/12;
System.out.print("\t\t\t" +
twoDigits.format(MIP));//my printout
NewBal=NewBal -(Payments-MIP);
System.out.println("\t\t\t" +
twoDigits.format(NewBal));//my printout
System.out.print(" " + twoDigits.format(Payments));
//my printout
if (NewBal <100000) // tells when this is met to
transition to sleep phase
try
Thread.sleep (500); //sleep phase needed per
change request also states pause is 500
millisecondsUgh - who told you to do this? Take it out.
catch (InterruptedException e)
import java.io.*; // java input output package
import java.text.DecimalFormat;
ublic class MonthlyPayments5 //class header
public static void main(String[] args) //don't know
if this is needed or not but here it is
double Loan;
double Rate1,Rate2,Rate3,
MonthlyInterest1,MonthlyInterest2,MonthlyInterest3,Pa
ment1,Payment2,Payment3; //double precision
variables
//assign values to variables
Loan= 200000; // loan amount
Rate1 = 5.75;
Rate2 = 5.5;
Rate3 = 5.35;
MonthlyInterest1 = (Rate1 / 100) / 12;
MonthlyInterest2 = (Rate2 / 100) / 12;
MonthlyInterest3 = (Rate3 / 100) / 12;
Payment1 = Loan * (MonthlyInterest1 / (1 -
Math.pow(1+MonthlyInterest1, -360))); //my formula
Payment2 = Loan * (MonthlyInterest2 / (1 -
Math.pow(1+MonthlyInterest2, -180))); //my formula
Payment3 = Loan * (MonthlyInterest3 / (1 -
Math.pow(1+MonthlyInterest3, -84))); //my formula
DecimalFormat twoDigits = new
DecimalFormat("000.00");
System.out.println("\tYour Monthly Payments for
30 years are:\t $" + twoDigits.format(Payment1));
//my printout
System.out.println("\tYour Monthly Payments for
15 years are:\t $" + twoDigits.format(Payment2));
//my printout
System.out.println("\tYour Monthly Payments for 7
years are:\t $" + twoDigits.format(Payment3)); //my
printout
}See above for same comments on second messy method.
%
Similar Messages
-
Combine to queries to make one report
Hello,
Is it possible to combine to queries to make one report?
I have been asked to create a report to shows the settlement status of a mileage report for the last two months and also in the same report show everything that has to be settled.
I have created two queries u2013 one that shows restricts by last two months and another that restricts settlement by u201Cto be settledu201D.
I would now like to combine these two queries to create one report. However in report designer when I insert the two queries it does not allow incorporating the two to make one report. It just allows you to leave one below the other.
Is there a way I can combine the two or is there something I can do in the query designer, because as far as I know you canu2019t use dimensions twice in the columns.
Thanks
ForhadHI Forhad Hussain,
Create a new query by adding all required keyfigures(settled & to be settled) using restricted key figures, instead of global restrictions.
Or enhance any of existing report by changing global restricting and adding new RKF's.
Hope it Helps
Srini -
How can I combine two itunes accounts into one?
How can I combine two itunes accounts into one?
Items purchased from the iTunes Store are permanently associated with the account from which they were originally purchased. Apple provides no way to change this.
However, if you wish to put content from two accounts into a single iTunes library, you can easily do so. Use the command File > Add File (or Folder) to Library. -
How do I combine several clips to make one movie?
The iPhone 6 doesn't have a video pause button (ingenious) so I recorded several clips. I downloaded these clips to iMovie and put them all in one event. When I play the event, the video jumps a little every time it goes from one clip to the next. Is there a way to combine the clips to make one movie that doesn't have those jumps. Thanks!
Thanks for your response. I already figured this out but was unable to post a reply sooner. I just figured out that you can't reply when you are in private browsing. Another Apple glitch. Regarding this issue, in typical Apple fashion, the products can be confusing to use, the user manuals are poorly written, the help menus, many times, aren't very helpful, and the product development decisions can be baffling.
In the case of video-making and editing, Apple has hit the triple-crown: First, the iPhone 6 video recorder doesn't have a pause button; Second, in iMovie, you CAN'T combine separate clips; And third, again in iMovie, you can't download clips directly from iPhoto - you have to move the clips out of iPhoto first. By the way, iPhoto is the default location when clips are uploaded to iCloud. Unbelievable!
For any first-time user reading this, a project is a movie or a trailer. And even when you are in a project, you can't combine separate clips. You can only combine a clip that was separated back to the clip it was separated from. Thanks, Karsten, for taking the time to respond. -
Reg: Combining two display lists into one list
Dear All,
i want to combine two display lists into one display list. Please give the idea for this one issue.
*****************dispaly list 1 starting here*********************
*& Form F_006_DISPLAY_LIST
* text
* --> p1 text
* <-- p2 text
FORM F_006_DISPLAY_LIST.
* TABLES : LFA1 .
DATA : V_DEBIT_TOTAL TYPE P DECIMALS 2 ,
V_CREDIT_TOTAL TYPE P DECIMALS 2 ,
V_CLOSE_BAL TYPE P DECIMALS 2 .
DATA : V_CNT TYPE I .
SORT ITAB_OPG BY LIFNR.
LOOP AT ITAB_OPG.
NEW-PAGE.
* Displaying Vendor Name
SELECT SINGLE NAME1 FROM LFA1 INTO LFA1-NAME1 WHERE
LIFNR EQ ITAB_OPG-LIFNR .
FORMAT COLOR COL_POSITIVE INTENSIFIED ON.
WRITE:/2 'Vendor Code:' ,
ITAB_OPG-LIFNR ,
40 LFA1-NAME1 .
CLEAR : LFA1 .
WRITE :/(190) SY-ULINE .
* Displaying Opening Balance
FORMAT COLOR COL_NEGATIVE INTENSIFIED ON .
READ TABLE ITAB_OPG WITH KEY LIFNR = ITAB_OPG-LIFNR .
IF ITAB_OPG-BAL LE 0 .
WRITE :/2 'Opening Balance for Period' , (4) S_MONAT-LOW , ':' ,
171(18) ITAB_OPG-BAL .
ELSE.
WRITE :/2 'Opening Balance for Period' , (4) S_MONAT-LOW , ':' ,
151(18) ITAB_OPG-BAL .
ENDIF.
WRITE :/(190) SY-ULINE .
* Displaying Line Items
LOOP AT ITAB_DISPLAY WHERE LIFNR EQ ITAB_OPG-LIFNR.
V_CNT = SY-TABIX MOD 2.
IF V_CNT EQ 0.
FORMAT COLOR COL_NORMAL INTENSIFIED ON.
ELSE.
FORMAT COLOR COL_NORMAL INTENSIFIED OFF.
ENDIF.
* Selecting Bank Name and Cheque Number
SELECT SINGLE CHECT HBKID INTO (PAYR-CHECT , PAYR-HBKID)
FROM PAYR WHERE
ZBUKR EQ P_BUKRS AND
VBLNR EQ ITAB_DISPLAY-BELNR AND
LIFNR EQ ITAB_DISPLAY-LIFNR .
SELECT SINGLE BANKS BANKL INTO (T012-BANKS , T012-BANKL) FROM
T012 WHERE BUKRS EQ P_BUKRS AND
HBKID EQ PAYR-HBKID.
SELECT SINGLE BANKA INTO BNKA-BANKA FROM BNKA WHERE
BANKS EQ T012-BANKS AND
BANKL EQ T012-BANKL .
WRITE :/2 ITAB_DISPLAY-BUDAT ,
14 ITAB_DISPLAY-BELNR ,
26 ITAB_DISPLAY-BLDAT ,
40 ITAB_DISPLAY-XBLNR ,
58(16) PAYR-CHECT ,
75 BNKA-BANKA ,
105(40) ITAB_DISPLAY-SGTXT ,
146(4) ITAB_DISPLAY-BLART .
* Determinig Debit or Credit
IF ITAB_DISPLAY-SHKZG EQ 'S'.
V_DEBIT_TOTAL = V_DEBIT_TOTAL + ITAB_DISPLAY-DMBTR.
WRITE:151(18) ITAB_DISPLAY-DMBTR ,
171(18) SPACE .
ELSEIF ITAB_DISPLAY-SHKZG EQ 'H'.
V_CREDIT_TOTAL = V_CREDIT_TOTAL + ITAB_DISPLAY-DMBTR.
WRITE:151(18) SPACE ,
171(18) ITAB_DISPLAY-DMBTR .
ENDIF.
CLEAR : T012 , BNKA , PAYR .
ENDLOOP.
FORMAT COLOR COL_TOTAL INTENSIFIED ON.
WRITE:/(190) SY-ULINE.
* Displaying Debit and Credit Totals
WRITE:/125 TEXT-001 ,
151(18) V_DEBIT_TOTAL ,
171(18) V_CREDIT_TOTAL .
WRITE:/(190) SY-ULINE.
* Displaying the Closing Balance
FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
V_CLOSE_BAL = ITAB_OPG-BAL + V_DEBIT_TOTAL - V_CREDIT_TOTAL .
IF V_CLOSE_BAL GT 0.
WRITE:/122 TEXT-002 ,
151(18) V_CLOSE_BAL NO-SIGN. " D00K909674
ELSEIF V_CLOSE_BAL LE 0.
WRITE:/122 TEXT-002 ,
171(18) V_CLOSE_BAL NO-SIGN. " D00K909674
ENDIF.
CLEAR : V_CLOSE_BAL.
ENDLOOP.
ENDFORM. " F_006_DISPLAY_LIST
*****************dispaly list 1 ending here*********************
*****************dispaly list 2 starting here*********************
*& Form F_006_DISPLAY_LIST1
* text
* --> p1 text
* <-- p2 text
FORM F_006_DISPLAY_LIST1 .
TABLES : KNA1 .
DATA : V_DEBIT_TOTAL1 TYPE P DECIMALS 2 ,
V_CREDIT_TOTAL1 TYPE P DECIMALS 2 ,
V_CLOSE_BAL1 TYPE P DECIMALS 2 .
DATA : V_CNT1 TYPE I .
SORT ITAB_OPG1 BY KUNNR.
LOOP AT ITAB_OPG1.
NEW-PAGE.
* Displaying Vendor Name
SELECT SINGLE NAME1 FROM KNA1 INTO KNA1-NAME1 WHERE
KUNNR EQ ITAB_OPG1-KUNNR .
FORMAT COLOR COL_POSITIVE INTENSIFIED ON.
WRITE:/2 'Customer Code:' ,
ITAB_OPG1-KUNNR ,
40 KNA1-NAME1 .
CLEAR : KNA1 .
WRITE :/(190) SY-ULINE .
* Displaying Opening Balance
FORMAT COLOR COL_NEGATIVE INTENSIFIED ON .
READ TABLE ITAB_OPG1 WITH KEY KUNNR = ITAB_OPG1-KUNNR .
IF ITAB_OPG1-BAL1 LE 0 .
WRITE :/2 'Opening Balance for Period' , (4) S_MONAT-LOW , ':' ,
171(18) ITAB_OPG1-BAL1 .
ELSE.
WRITE :/2 'Opening Balance for Period' , (4) S_MONAT-LOW , ':' ,
151(18) ITAB_OPG1-BAL1 .
ENDIF.
WRITE :/(190) SY-ULINE .
* Displaying Line Items
LOOP AT ITAB_DISPLAY1 WHERE KUNNR EQ ITAB_OPG1-KUNNR.
V_CNT1 = SY-TABIX MOD 2.
IF V_CNT1 EQ 0.
FORMAT COLOR COL_NORMAL INTENSIFIED ON.
ELSE.
FORMAT COLOR COL_NORMAL INTENSIFIED OFF.
ENDIF.
* Selecting Bank Name and Cheque Number
SELECT SINGLE CHECT HBKID INTO (PAYR-CHECT , PAYR-HBKID)
FROM PAYR WHERE
ZBUKR EQ P_BUKRS AND
VBLNR EQ ITAB_DISPLAY1-BELNR AND
KUNNR EQ ITAB_DISPLAY1-KUNNR .
SELECT SINGLE BANKS BANKL INTO (T012-BANKS , T012-BANKL) FROM
T012 WHERE BUKRS EQ P_BUKRS AND
HBKID EQ PAYR-HBKID.
SELECT SINGLE BANKA INTO BNKA-BANKA FROM BNKA WHERE
BANKS EQ T012-BANKS AND
BANKL EQ T012-BANKL .
WRITE :/2 ITAB_DISPLAY1-BUDAT ,
14 ITAB_DISPLAY1-BELNR ,
26 ITAB_DISPLAY1-BLDAT ,
40 ITAB_DISPLAY1-XBLNR ,
58(16) PAYR-CHECT ,
75 BNKA-BANKA ,
105(40) ITAB_DISPLAY1-SGTXT ,
146(4) ITAB_DISPLAY1-BLART .
* Determinig Debit or Credit
IF ITAB_DISPLAY1-SHKZG EQ 'S'.
V_DEBIT_TOTAL1 = V_DEBIT_TOTAL1 + ITAB_DISPLAY1-DMBTR.
WRITE:151(18) ITAB_DISPLAY1-DMBTR ,
171(18) SPACE .
ELSEIF ITAB_DISPLAY1-SHKZG EQ 'H'.
V_CREDIT_TOTAL1 = V_CREDIT_TOTAL1 + ITAB_DISPLAY1-DMBTR.
WRITE:151(18) SPACE ,
171(18) ITAB_DISPLAY1-DMBTR .
ENDIF.
CLEAR : T012 , BNKA , PAYR .
ENDLOOP.
FORMAT COLOR COL_TOTAL INTENSIFIED ON.
WRITE:/(190) SY-ULINE.
* Displaying Debit and Credit Totals
WRITE:/125 TEXT-001 ,
151(18) V_DEBIT_TOTAL1,
171(18) V_CREDIT_TOTAL1 .
WRITE:/(190) SY-ULINE.
* Displaying the Closing Balance
FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
V_CLOSE_BAL1 = ITAB_OPG1-BAL1 + V_DEBIT_TOTAL1 - V_CREDIT_TOTAL1 .
IF V_CLOSE_BAL1 GT 0.
WRITE:/122 TEXT-002 ,
151(18) V_CLOSE_BAL1 NO-SIGN. " D00K909674
ELSEIF V_CLOSE_BAL1 LE 0.
WRITE:/122 TEXT-002 ,
171(18) V_CLOSE_BAL1 NO-SIGN. " D00K909674
ENDIF.
CLEAR : V_CLOSE_BAL1.
ENDLOOP.
ENDFORM. " F_006_DISPLAY_LIST1
*****************dispaly list 2 ending here*********************
Thanks,
Sankar MHi,
Can you post it as two halves ?
Regards,
Swarna Munukoti -
How do I combine two iTunes accounts to one.?
How do I combine two iTunes accounts into one?
iTunes Account = Apple ID...
From Here http://support.apple.com/kb/HE37
I have multiple Apple IDs. Is there a way for me to merge them into a single Apple ID?
Apple IDs cannot be merged. You should use your preferred Apple ID from now on, but you can still access your purchased items such as music, movies, or software using your other Apple IDs. -
How do I combine two slide shows into one?
I need to combine two slide shows into one and put the whole thing into a loop for a Kiosque. Can someone help?
Drag and drop the slides from the Thumbnail viewer (left side of the window) from one Keynote to the other. They should copy with all the Actions and Transitions still in place. Then go to Inspector>Document Tab and check the box that says to Loop slideshow.
-
Combining two sales documents into one billing document
Hi Friends,
I need to combine two sales document into one billing document. Header data is same in both sales document.
I have set factory calendar in the payer master.
Tried for data transfer rotine at copy control of item level. But was not sure which routine to be set.
Please let me know, what all settings are required to create one combine billing document.
Regards
SumanHi,
Is it delivery based billing or order based billing?
2 orders / 2 deliveries and 1 invoice.
For the above situation you need to write a routine which eliminates document number difference for Reference and Allocation.
If you do not have different customer purchase orders for these two sales orders and in your copy control from delivery to billing your assignment and reference numbers are blank then system will club these deliveries and create one sales order.
Else you need to eliminate these by writing a copy control routine and assign it at the header level.
Hope this helps. Pl. revert in case of further clarifications.
Thanks
Krishna. -
Combine two date field into one timestamp field
Hello all,
I need help combining two date fields into one timestamp field.
I have separate Date and Milliseconds fields and want to
combine to one Timestamp field can some suggest sql???This is my data
01 JAN 1989 12:01:00.001 AM
this is my insert drag_time is a timestamp field in another schema
INSERT
INTO DRAG (drag_time)
SELECT to_char(drag_time, 'DD MON YYYY HH12:MI:SS')||(drag_second)||to_char(drag_time, ' AM')
FROM sa.drag;
This is the error
ERROR at line 3:
ORA-01855: AM/A.M. or PM/P.M. required -
Search view : Combine two search views into one serch view
Hi ,
We have a requirement for combining two search views into one and display single result view consisting of some fields from One search and few fields from other search.
Ex. There are two seperate search views for Oppotunity and Quotation. Now we want to combine search views of both into one search view with selected fields and then display a single result view with combined fields from both result views .
Kindly suggest me the steps I can follow to achieve the same.
Thanks,
MadhuraHi,
This is possible by creating dynamic views in a window.
1)create views you required.
2)create a tray in the view 1 and a link and set the properties.
3)create an outbound plug for the view1 and save the application.
4)create one more link in the tray for view1 and set the properties and create one more outbound plug.
5)go the main view view and create 2nd tray and create a UI container element in it.
6) now embed view1 and view2 in the container .........................
<removed_by_moderator>
regards,
Muralidhar .C
Edited by: Stephen Johannes on Jan 26, 2010 7:53 AM -
Is it possible to combine two pivot report into one ?..
Is it possible to combine two pivot report into one ?..
Then trying to display a chart or table result.Thanks for the reply.
Let me explain it briefly. I am creating a Report 1 based on one fitler condition and second report is created based on second filter condition.
I have similar column (time periods) in the both report. Then measure column has to combine and show as single report.
This is my requirement. -
How do I combine two PDF files into one?
I want to merge two PDF files into one to make things easier when I take the file(s) to a professional printer.
Can I do this in Preview?
Thanks.You can't do in Preview.
You can combine individual PDFs into one PDF using one of these freeware utilities.
PDFMergeX @ http://www.malcom-mac.com/blog/pdfmergex/
joinPDF @ http://www.macupdate.com/info.php/id/16604
Combine PDFs @ http://www.monkeybreadsoftware.de/Freeware/CombinePDFs.shtml>
PDFLab (join & split) @ http://pdflab.en.softonic.com/mac
Cheers, Tom -
Combining two single recordset into one two column recordset
Hi Forum
Assume we have three types , each 'table of'
CREATE OR REPLACE type type1 as table of number ;
CREATE OR REPLACE type type2 as table of varchar2 (255);
CREATE OR REPLACE TYPE TYPEVALUE AS OBJECT
(object_type number ,
object_value varchar2(255)
resultset1 type1 := type1() ;
resultset2 type2 := type2() ;
resultset3 typevalue := typeValue3() ;
I want to populate records of resultset3 from resultset1 and resultset2 , using resultset1 for first column of record and resultset2 for second column.
One way is to do for loop but I don't want to use this.
I need something similar to resultset3 to use it dynamically in select statement to do MINUS operation with another resultset . I think things like MULTISET, COLLECT, CAST can achieve what I want to do.
Can you please help me to have a select statement that combines two single column rowset and put into a two column recordset.
ThanksHi,
You can do something like this:
SQL> create or replace type type1 as table of number;
2 /
Type created.
SQL> create or replace type type2 as table of varchar2(255);
2 /
Type created.
SQL> create or replace type typevalue as object(object_type number, object_value varchar2(255));
2 /
Type created.
SQL> create type typevalue_tab as table of typevalue;
2 /
Type created.
SQL> ed
1 declare
2 resultset1 type1 := type1(1, 2, 3, 4, 5);
3 resultset2 type2 := type2('one', 'two', 'three', 'four', 'five');
4 resultset3 typevalue_tab;
5 begin
6 for l_res in (
7 select typevalue(t1.col1, t2.col2) as col
8 from (
9 select column_value col1
10 , rownum rn
11 from table(cast(resultset1 as type1))
12 ) t1
13 , (
14 select column_value col2
15 , rownum rn
16 from table(cast(resultset2 as type2))
17 ) t2
18 where t1.rn = t2.rn
19 )
20 loop
21 dbms_output.put_line(
22 'Object Type: '||l_res.col.object_type||' '||
23 'Object Value: '||l_res.col.object_value
24 );
25 end loop;
26* end;
SQL> /
Object Type: 1 Object Value: one
Object Type: 2 Object Value: two
Object Type: 3 Object Value: three
Object Type: 4 Object Value: four
Object Type: 5 Object Value: five
PL/SQL procedure successfully completed.All the work here is done in SQL so it should work similarly if you have these things defined as nested table columns in the database.
However, there is a caveat here: the lines highlighted in bold above are defining an arbitrary ordering for the nested table elements using rownum, as there is no concept of ordering within a nested table. You should change this part of the query to whatever makes sense in your environment, otherwise this solution cannot be guaranteed to be correct. Another option would be to use VARRAYs, as they will retain the order of elements.
cheers,
Anthony -
Combine Two Crystal Report In One Report
Hi
I made a two crystal report in that two report i used subreport
I want to combine this two report.
that is i have to make multilevel crystal report.
when i Combine this two report
the subreport which is contain in that two report is not import.
so how can i import this two reports in one.Hi,
When you combine two reports, you can only have one subreport working directly. Then other subreport has to be recreated in the new report.
Thanks,
Gordon -
Combine two iMovie projects into one iDVD project?
Could someone help me figure out the best way to combine two iMovie (HD 5) projects into one iDVD project? I currently have a documentary with one iMovie project at 1 hour exactly. I am starting a second one and would like all this to go on one DVD eventually. I am especially concerned about what happens with the chapter markers already created in each iMovie project - how is that combined when the two are put together? If there is a link for this info, I'd be happy to read that as well.
Thank you!I would combine them by saving each completed imovie (without chapter markers) as a full quality QuickTime movie.
Then start a completely new imovie project and import each of those in to make make one large imovie. (But remember, your DVD will only hold about 120 minutes of footage and that doesn't count the themes).
That's when I would add the chapter markers.
BTW-it's going to take up a lot of disk space to save the movie s and to burn the DVD.
Sue
Maybe you are looking for
-
Reg: ADF_FACES-60097
Hi, We have a popup in a page, while clicking OK button in the popup, we are getting the issue like… java.lang.NullPointerException ADF_FACES-60097:For more information, please see the server's error log for an entry beginning with: ADF_FACES-60096:S
-
I started the update for IOS 7 and now I am getting a message with a charger pointing to I Tunes, I try to turn my phone off and the same message comes up. Not sure if this is part of the updating process, or if my phone is damaged. Has anyone out th
-
All Of A Sudden My Buddies On iChat Have Dissappeared Except for One
Hi: I logged in to iChat and discovered that all of my listed buddies are gone except for one. Any help on how to recover them? thanks Kirk
-
Note: Ticket Number 11362 is now displayed under iOS Diagnostics. The display on my iPhone does not fit the screen. It is so large that I have to move around the screen to find "Slide to Unlock". By the time I have unlocked to answer a call, the iPho
-
Hello, I am using with MS SQL Server. I use for SELECT as pstmtSelect = conn.prepareStatement( "select Id, Description from Stock where Id = ?"); What is the syntax for using LIKE in the WHERE clause? ( I would like to use - WHERE Id LIKE ......?). T