Using Arrays in a program
First, I would like to thank everyone in this forum for all the help they have given me over the past few weeks. With that said, I am currently trying to alter the following code to accept and use arrays to end to produce three seperate results. The program now as three hard coded variables which are
Amount = 200000.00;
Term = 30;
InterestRate = .0575;
I need to have the program work the same, but produce results for three different Terms and Three different periods. Below is the code the I am working on, I have added two arrays containing the required information. I am having a hard time coming up with a for statment to move the program through the two arrays. Any pushes in the right direction would be great. I left the hard code variable in place, I know that I do need to remove them and alter the equations. I just thought it would be easier for everyone to understand if I left the code in working form.
import java.math.*;
import java.text.*;
import java.util.*;
// The Payment class displays a predetermined monthly mortgage payment
public class Payment
public static void main(String[]arguments)
//Creates Two Arrays for InterestRates and Terms
double[] InterestRates = {.0535, .055, .0575};
int[] Terms = {7, 15, 30};
//Creates variables
double Amount;
int Term;
double InterestRate;
//Assigns values to variables
Amount = 200000.00;
Term = 30;
InterestRate = .0575;
//Alters the display format of Amount variable
NumberFormat n = NumberFormat.getCurrencyInstance(Locale.US);
String s = n.format(Amount);
//Creates variables
double MonthlyInterestRate;
int TotalMonths;
double Payment;
//Assigns values to variables
MonthlyInterestRate = InterestRate / 12;
TotalMonths = Term * 12;
Payment = Amount* MonthlyInterestRate / (1-(Math.pow((1+MonthlyInterestRate ),(-TotalMonths))));
//Takes Payment variable and round answer to 2 decimal points
BigDecimal bd = new BigDecimal(Payment);
bd = bd.setScale(2, BigDecimal.ROUND_DOWN);
//Instructions to display various varibles
System.out.println("Cost of Mortgage "+ s);
System.out.println("Length of Term " + Term);
System.out.println("Interest Rate 5.75% ");
System.out.println("The monthly payment of this loan is $" + bd);
System.out.println();
//Creates new set of variables
double MonthlyInterest;
double MonthlyPrincipal;
double TotalInterestPaid;
int NumberofPayments;
//Creates Balance variable
double Balance;
//Initialization of Balance variable
Balance = 200000;
TotalInterestPaid = 0;
NumberofPayments = 360;
//Creates a loop that calculates the entire term of loan
do
MonthlyInterest = Balance * (InterestRate / 12);
MonthlyPrincipal = Payment - MonthlyInterest;
Balance = Balance - MonthlyPrincipal;
TotalInterestPaid = TotalInterestPaid + MonthlyInterest;
NumberofPayments = NumberofPayments - 1;
//Takes current balance and rounds the answer to two digits
BigDecimal bb = new BigDecimal(Balance);
bb = bb.setScale(2, BigDecimal.ROUND_DOWN);
BigDecimal tip = new BigDecimal(TotalInterestPaid);
tip = tip.setScale(2, BigDecimal.ROUND_UP);
System.out.println("New Loan Balance " + bb);
System.out.println();
System.out.println("Total Interest Paid " + tip);
System.out.println();
System.out.println("Number of Payments remaining " + NumberofPayments);
System.out.println();
//The following lines of code pauses the loop to allow the user to read the output
//The speed of th display can be adujusted to a wide variety of speeds
try
Thread.sleep(400);
catch (InterruptedException exc)
//Loop condition
while (NumberofPayments > 0);
//Ends Application
Try this. It should give you some ideas. :)
import java.math.BigDecimal;
import java.text.NumberFormat;
import java.util.Locale;
// The Payment class displays a predetermined monthly mortgage payment
public class Payment {
public static final NumberFormat CURRENCY_FORMAT = NumberFormat.getCurrencyInstance(Locale.US);
public static final double[] INTEREST_RATES = {.0535D, .055D, .0575D};
public static final int[] TERMS = {7, 15, 30};
public static final double AMOUNT = 200000.00;
public static final int MONTHS_PER_YEAR = 12;
public static void main(String[] arguments) {
for (int t = 0; t < TERMS.length; t++) {
for (int i = 0; i < INTEREST_RATES.length; i++) {
displayPayments(AMOUNT, INTEREST_RATES, TERMS[t]);
private static void displayPayments(double amount, double interestRate, int term) {
//Creates variables
//Assigns values to variables
double monthlyInterestRate = interestRate / MONTHS_PER_YEAR;
int totalMonths = term * MONTHS_PER_YEAR;
double payment = amount * monthlyInterestRate / (1 - Math.pow(1 + monthlyInterestRate, -totalMonths));
//Instructions to display various varibles
System.out.println("Cost of Mortgage " + CURRENCY_FORMAT.format(amount));
System.out.println("Length of Term " + term);
System.out.println("Interest Rate " + new BigDecimal(interestRate * 100).setScale(2, BigDecimal.ROUND_HALF_UP) + '%');
System.out.println("The monthly payment of this loan is " + CURRENCY_FORMAT.format(payment));
System.out.println();
//Creates new set of variables
double totalInterestPaid = 0.0D;
//Creates balance variable, Initialization of balance variable
double balance = amount;
//Creates a loop that calculates the entire term of loan
System.out.println("New Loan balance, Total Interest Paid, Number of Payments remaining");
for (int numberofPayment = totalMonths; numberofPayment > 0; numberofPayment--) {
double monthlyInterest = balance * monthlyInterestRate;
double monthlyPrincipal = payment - monthlyInterest;
balance -= monthlyPrincipal;
totalInterestPaid += monthlyInterest;
//Takes current balance and rounds the answer to two digits
BigDecimal bb = new BigDecimal(balance);
bb = bb.setScale(2, BigDecimal.ROUND_DOWN);
BigDecimal tip = new BigDecimal(totalInterestPaid);
tip = tip.setScale(2, BigDecimal.ROUND_UP);
System.out.println(CURRENCY_FORMAT.format(bb.doubleValue()) + ", " +
CURRENCY_FORMAT.format(tip.doubleValue()) + ", " +
numberofPayment);
System.out.println();
//Ends Application
Similar Messages
-
HI all,
I am working on a program that will print out my initials 'A' and 'T' using arrays. I am asked to initialize the first intial to '*' and the second intial to '@'. I wrote the code but the output is wrong. Can someone help me by letting me know what I am doing wrong in my arrray?I just get back my array of 30X30. I also wrote a driver but when I run the program, I really appreciate it so much.
public class Initial
private char whichinitial ;
private int MAX =30;//Maximum amount for 2-d Matrix
char[][] letterMatrix = new char[MAX][MAX];//2-d Array 30 x30
private boolean first = true;
public Initial()
{ //FIlls Array full of '*'s
whichinitial = '*';
for(int i=0;i< MAX;i++)
for(int j=0;i< MAX;i++)
letterMatrix[i][j] = whichinitial;
public void setLetter(char letter)
{//Setter for Letter
whichinitial = letter;
public char getLetter()
{//Getter for Letter
return whichinitial;
public void firstLetter()
{ //Creates an A shape
for(int i=0;i< MAX;i++)
for(int j=0;j< MAX;j++)
if((i>0)|| ((i<6) || ((j>0) && (j<29))))
letterMatrix[j] =whichinitial;
public void secondLetter()
{//Creates an T shape
first = false;
for(int i=0;i <MAX;i++)
for(int j=0;j <MAX;j++)
if((i>1) ||(j < 29)||(j>5)||(i>10))
letterMatrix[i][j] = whichinitial;
public void display()
{//Displays the Initials
if(first)
System.out.println("\n \n \n My First Initial," + whichinitial + ", follows:");
else
System.out.println("\n \n \n My Last Initial," + whichinitial + ", follows:");
for(int i=0;i <MAX;i++)
System.out.println();
for(int j=0;j <MAX;j++)
if(letterMatrix[i][j] == '*')
System.out.print(" ");
else
System.out.print(letterMatrix[i][j]);I am trying to write a program using a matrix. The size of the maxtrix should be 30X30. The first initial shoulld be initialized to '*' and the secind initial should be initialized to '@'. Both initials should be 30 characters high and 30 characters wide and the initials should also represent the uppercase letter of your initials. I know that the first initial's matrix needs to be filled up vertically and the second initial needs to be filled horizontally but the output is wrong....PLease Help!
Message was edited by:
apples03 -
Hi Guys,
I always had a few problems using arrays and now I need to use them and I am stuck.
on my program i need to create an array of int with the numbers 1 to 1000 in it for this I have done:
int[ ] array;
on the class constructor
array = new int[1000];
to fill the array:
for (int i = 0; i < array.length; i++)
array[i] = i;
The problem is that I always get an ArrayIndexOutOfBoundsException error.
I know how to solve it which is to create an array with 1001 elements but is there a more elegant way of creating the array or this is the way to do it?
To put my question in another way if any of you Guys was creating this program which way would you do it.
Best regards
LuisSloppy of me. This is a bit better:
package cruft;
import java.util.Arrays;
* A class for a one-based array of ints.
public class OneBasedIntArray
private int [] values;
public static void main(String[] args)
int [] values = new int[args.length];
for (int i = 0; i < args.length; i++)
values[i] = Integer.parseInt(args);
OneBasedIntArray intArray = new OneBasedIntArray(values);
System.out.println(intArray);
public OneBasedIntArray(int[] values)
this.values = new int[values.length];
System.arraycopy(values, 0, this.values, 0, values.length);
public int getValue(int index)
if (index <= 0)
throw new IllegalArgumentException("this array is one-based");
return values[index-1];
public void setValue(int index, int value)
if (index <= 0)
throw new IllegalArgumentException("this array is one-based");
this.values[index-1] = value;
public boolean equals(Object o)
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
OneBasedIntArray intArray = (OneBasedIntArray) o;
if (!Arrays.equals(values, intArray.values))
return false;
return true;
public int hashCode()
return (values != null ? Arrays.hashCode(values) : 0);
public String toString()
StringBuilder builder = new StringBuilder();
builder.append("OneBasedIntArray{");
for (int i = 0; i < values.length; i++)
builder.append("(").append(i+1).append(",").append(values[i]).append(")");
builder.append('}');
return builder.toString(); -
Can i use array.count in line?
All,
I have one small oracle program that take a ',' separated string as an input
and assigns the individual string to a nested table.
I am wondering if I can directly use array.count in my sql below
instead of assigning the count of the array 1st and then
using it.
l_cause_codes_array := util_pkg.tokenize_string(p_cause_codes_csv, ',');
l_count := l_cause_codes_array.count;
My current sql:
delete from po_complaint_cause p
where p.po_number = p_po_number
and p.comp_code = p_comp_code
and l_count > 1;
I would like to do something like:
delete from po_complaint_cause p
where p.po_number = p_po_number
and p.comp_code = p_comp_code
and l_l_cause_codes_array.count> 1;
I just want to reduce one context switch if possible.
Thanks.Hi,
did it give an error? Did you try? But it is possible.
But why not the next code:
l_cause_codes_array := util_pkg.tokenize_string(p_cause_codes_csv, ',');
if l_cause_codes_array.count >1
then
delete from po_complaint_cause p
where p.po_number = p_po_number
and p.comp_code = p_comp_code
end if;Do only the delete if it is bigger than 1, that is I think the fastest switch.
Herald ten Dam
http://htendam.wordpress.com -
Multiple variable initialization using arrays
Hi,
In my program I want to initialize some 20 odd variables(all of the same type) to the same value having their names as Input1, Input 2 .. Input 20. Want I want to do is to use an array to do this rather than writing the 20 variables one after the other. Is there any way to do so ?
Please help.
Thanx in advance,
GauravHi Again,
I am sorry for framing the question wrongly. What i want exactly is this :
I want to create a variable no. of arrays (the number of arrays will be inputed by the user). I want to initialize them ,something like this
int Input1 [] = new int [400];
int Input2 [] = new int [400];
After this initialization I will then fill these with some info. from a file and then use it in my program.
So I want to use a for loop or some other loop so that I can achieve this.
Please help,
Thanks
Gaurav -
I have an Object[] Array and I wish to remove index 'x' from that Object[] Array. If I use Arrays.asList() passing in the existing Object[] Array I will get new List Object containing the objects from the Object[] Array. Is it guaranteed that index 'x' from the Object[] Array is the same Object from the index 'x' in the new List?
Object[] obj = new String[] {"obj_0", "obj_1", "obj_2", "obj_3"};
List list = Arrays.asList(obj);
assertTrue(obj[0] == list.get(0));
assertTrue(obj[1] == list.get(1));
assertTrue(obj[2] == list.get(2));
assertTrue(obj[3] == list.get(3));Are the above assertions always guaranteed to be true?Jared_java_dev wrote:
I thought the JavaDoc API would state it as well. I did originally check that.
I agree that it should keep the order but I wanted to verify this behavior. It would make some coding logic much more simple.
Objective is to remove ojb[2]
String[] obj = new String[] {"obj_0", "obj_1", "obj_2", "obj_
//Perferred logic
List<String> list = Arrays.asList(obj);
//remove unwanted element
list.remove(2);
//create new Object[] without unwanted element
obj = (String[]) list.toArray();
{code}
as opposed to
{code}
String[] obj = new String[] {"obj_0", "obj_1", "obj_2", "obj_
//unwanted logic
List<String> list = Arrays.asList(obj);
for (int x = 0; x < obj.length; x++) {
// == or String.equals
if (list.get(x) == (obj[x])) {
list.remove(x);
obj = (String[]) list.toArray();I guess that I could write a sample program and run to verify this .
Thanks for everyone's input.No, you won't be able to simply 'delete' items from this array-backed list. It is a fixed size list, so additions/deletions are expected to throw exceptions.
So now my question is: Why is the master an array in the first place? Seems like it should be a List from the get-go. -
i have one problem about using addKeyListener, i'm using array to create JLabel but once i've compile it, it came out a message as i shown, so where is my problem, hope someone can fix it for me and explain it for me, thank you
---------- Capture Output ----------
"C:\Program Files\Java\jdk1.6.0_03\bin\javac.exe" Login.javaLogin.java:78: not a statement
inputTextName[1]KeyPressed( event );
^
Login.java:78: ';' expected
inputTextName[1]KeyPressed( event );
^
2 errors
Terminated with exit code 1.---------- Capture Output ----------
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class Login extends JFrame
//JLabel[] lblName = {"lblName1","lblName2"};
JLabel[] labelName;
//JTextField[] txtfldName = {input1,input2};
JTextField[] inputTextName;
//JLabel[] array = new JLabel[veryLargeNumber];
JButton[] btnName = new JButton[3];
public void userInterface()
this.setBackground(Color.blue);
this.setTitle("Log in");
this.setSize(285,130);
this.setVisible(true);
Container contentPane = getContentPane();
contentPane.setLayout(null);
labelName[0] = new JLabel();
labelName[0].setText("ID: ");
labelName[0].setBounds(16, 16, 130, 21);
this.add(labelName[0]);
inputTextName[0] = new JTextField();
inputTextName[0].setText(" ");
inputTextName[0].setBounds(50, 16, 150, 21);
inputTextName[0].setHorizontalAlignment(JTextField.LEFT);
this.add(inputTextName[0]);
labelName[1] = new JLabel();
labelName[1].setText("Password: ");
labelName[1].setBounds(16, 48, 104, 21);
this.add(labelName[1]);
inputTextName[1] = new JTextField();
inputTextName[1].setText(" ");
inputTextName[1].setBounds(50, 48, 150, 21);
inputTextName[1].setHorizontalAlignment(JTextField.LEFT);
this.add(inputTextName[1]);
btnName[0] = new JButton();
btnName[0].setText("login");
btnName[0].setBounds(120,80,65,20);
this.add(btnName[0]);
btnName[1] = new JButton();
btnName[1].setText("exit");
btnName[1].setBounds(190,80,65,20);
this.add(btnName[1]);
inputTextName[1].addKeyListener(
new KeyAdapter() // anonymous inner class
// method called when user types in cartonsJTextField
public void keyPressed( KeyEvent event )
inputTextName[1]KeyPressed( event );
} // end anonymous inner class
); // end call to addKeyListener
//call function
public Login()
userInterface();
public static void main (String args[])
Login application = new Login();
application.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
}Edited by: slamgundam on Oct 24, 2007 11:48 PMslamgundam wrote:
the purpose is try to get the text in the inputTextField
inputTextName[1].addKeyListener(
new KeyAdapter()
// method called when user types in cartonsJTextField
public void keyPressed( KeyEvent event )
String str = inputTextName[1].getText();
System.out.println(str);
); -
How to I get a link with a "Mail to" address to open up a Compose window in my Yahoo mail, rather than in the Mail progrom on my Mac. I do not use the Mac Mail program.
== This happened ==
Not sure how often
== alwaysThank you, "the-edmeister" -- You render a great service, one that lifts my spirits.
Your answer also taught me to be a little more persistent, as I had started looking at Preferences, and just didn't notice the icons (including Applications) at the top of that window that would have led me to my answer.
Dave -
How to find out top 10 records from the R/3 using Java code (WD Program)
Hi Experts,
I have used Java Web Dynpro program to fetch records from the backend. Following code helps me and fetches record. As per the customer reqirement, we have to fetch only top 10 records (Actual Cost) from the backend. So I have to modify the Java code. How I can do so? Please help.
wdContext.nodeGraphData().invalidate();
IPublicCostcnt.IGraphDataElement categoryElement;
for (int i = 0; i < wdContext.nodeItab_Final1().size(); i++) {
categoryElement = wdContext.createGraphDataElement();
categoryElement.setCostElement(""+ wdContext.nodeItab_Final1().getItab_Final1ElementAt(i).getDescription());
categoryElement.setActualCost(wdContext.nodeItab_Final1().getItab_Final1ElementAt(i).getActual_Cost().toString());
categoryElement.setPlannedCost(wdContext.nodeItab_Final1().getItab_Final1ElementAt(i).getPlan_Cost().toString());
wdContext.nodeGraphData().addElement(categoryElement);
Regards,
GaryDear SDN Users,
This is how I resolved the issue.
1) Requested ABAPer to provide me sorted data. The data has been sorted in descending order of actual_cost.
2) After that I used following code. This resolved the issue.
if (wdContext.nodeItab_Final1().size()>10){
IPublicCostcnt.IGraphDataElement categoryElement;
for (int i = 0; i < 10; i++) {
categoryElement = wdContext.createGraphDataElement();
categoryElement.setCostElement(""+ wdContext.nodeItab_Final1().getItab_Final1ElementAt(i).getDescription());
categoryElement.setActualCost(wdContext.nodeItab_Final1().getItab_Final1ElementAt(i).getActual_Cost().toString());
categoryElement.setPlannedCost(wdContext.nodeItab_Final1().getItab_Final1ElementAt(i).getPlan_Cost().toString());
wdContext.nodeGraphData().addElement(categoryElement);
if (wdContext.nodeItab_Final1().size()<=10){
if (wdContext.nodeItab_Final1().size()>0){
IPublicCostcnt.IGraphDataElement categoryElement;
for (int i = 0; i < wdContext.nodeItab_Final1().size(); i++) {
categoryElement = wdContext.createGraphDataElement();
categoryElement.setCostElement(""+ wdContext.nodeItab_Final1().getItab_Final1ElementAt(i).getDescription());
categoryElement.setActualCost(wdContext.nodeItab_Final1().getItab_Final1ElementAt(i).getActual_Cost().toString());
categoryElement.setPlannedCost(wdContext.nodeItab_Final1().getItab_Final1ElementAt(i).getPlan_Cost().toString());
wdContext.nodeGraphData().addElement(categoryElement);
Regards,
Gary -
New computer win 8.1 pro, installed my creative Suite 4 Design premium but it shuts down when I try to use any of the programs and gives me an error code 147:20. How can I fix this? Is this a conflict with win 8.1 pro?
You need to adjust your security stuff/ permissions and possibly use compatibility modes. It means that your licensing service is being blocked/ shut down.
Mylenium -
Pages 4.3 was a useful technical word processing program; Pages 5 is not. Does anone know is Apple intends to improve Pages 5 at least to the level of Pages 4.3?
We used 4.3 as an effective tool for thesis production but in many ways it has become kind of a simplistic joke. Sad indeed and I wish there was some evidence they were remotely concerned. PeterBreis0807's response of "No" is spot on. We will continue to use 4.3 as long as it works as a time-saving substitute for Word.
-
How to get list of custom objects used in abap report program?
Hi friends,
I have a requirement in which I have to scan the entire abap report and retrieve list of custom objects used in it for example custom tables, data elements, structures, table types etc,. Is there any provision in SAP like fuction modules to do this functionality? As of now I am coding everything manually where so many possibilities are there for all kinds of objects. Provide your answers and suggestions...
Thanks,
NasteraHi,
The best way to do this is environment analysis. Follow the steps:
1. Open se38, type in the program name (don't click on on display/change or create button, stay on first screen only)
2. Click on environment analysis button (hot key SHIFT+F4)
3. It will throw a pop-up, which will ask for type of object you want to see, which are linked /used by this program. select all (or may be if you are only interested in Tables, then select table only)
4. Hit 'Enter'
You will get the full list of all objects used in this report program. Just note down the one which starts with Z or Y and that's it.
Cheers,
Anid -
I have a Mac computer and am trying to use a Photoshop CS4 program, but after accessing my desktop files through Adobe Bridge and clicking twice on any of the pictures to get into Photoshop, instead of entering photoshop, I get on the lefthand side an enlarged version of the picture with red, yellow and green buttons on top. Any suggestions on what is wrong, or what can be corrected ?
And there is the problem. Your pictures are opening up in Mac's own Preview app.
Do you want all your jpegs to open in Photoshop, or only when you are in Bridge?
Selecting a program to open a certain file is called: File Type Association.
You can choose this at the MacOS level or the Bridge level.
Here's how to do both:
Either MacOS or Bridge has the wrong app associated with the jpeg. Let's start with MacOS
Close Bridge and Preview. Select one of your jpegs, and press Cmd i, That will bring up the file info window.
Go down to the "Open with" section of File Info.
Choose Photoshop CS4 and click on the Change All... button to apply this choice to every jpeg on your Mac.
Then open Bridge and see if double-clicking opens it in Photoshop.
Now that means all jpegs on your Mac will open in Photoshop. Maybe you don't want that.
You can set your jpegs to open in Preview when Bridge is closed.
When you open Bridge, there is Preferences > File Type Associations where you can direct Bridge to open the jpegs in Photoshop when you are viewing in Bridge. -
When attempting to use Lightroom external editor program to edit a photo in Photoshop Elements 10, the photo does not open / appear on photoshop elements screen. I don't have any problem with this when using Photoshop Elements 6 or Photoshop CS. I'm using a Mac with Mountain Lion OS. Any solutions?
Adobe now hides the editor - what looks like it is not - you want the editor hidden in the support folder - see http://forums.adobe.com/message/3955558#3955558 for details
LN -
I have just purchased a used MacBook Pro. Should I use a virus protection program on this computer? I can get Norton for free through my cable provider. Thanks, funkro
See my Mac Malware Guide.
This issue is more complex than some of the responses you have gotten are indicating. You definitely should avoid Norton, but there actually IS malware out there, and all anti-virus software is NOT "snake oil." Don't listen to anyone who tells you otherwise, as they don't know what they're talking about.
Although you should be able to do without anti-virus software just fine, there are some perfectly good reasons to install it and some good anti-virus apps to use if you decide to do so. Further, even if you do avoid anti-virus software, you need to understand what the threats are so you don't end up thinking you're totally safe and do something you shouldn't.
Maybe you are looking for
-
HP LaserJet P3015 Creating its own copy in Control Panel
Hi Everyone, I am new here.I've a HP LaserJet P3015 printer which is connected with my laptop via USB cable. Whenever i connect the cable to another port of the laptop it creates the copy of the printer naming with (Copy 1). Cna anyone help me immedi
-
Suggestions on 5.1 external sound card
Hello to all and Happy New Year! Hope everyone had fun and were kept safe. I am in need of a 5.1 external sound card for my PB. Any suggestions, opinions, or actual experience with such would be greatly appreciated. Thanks, Quick
-
[SOLVED] Cinnamon stuck in US keyboard layout
I can't seem to get Cinnamon to use a UK keyboard layout. At the GDM login prompt the keyboard layout is correct, but as soon as I log in to cinnamon it switches to a US layout. I can't find any Cinnamon setting applets to change the keyboard layout
-
API / Webservice to access the state information of a bpel process instance
Hi, i have a question about the ccBPM runtime API. Is there a API or Webservice provided by SAP XI/PI, which accesses the state information of a bpel process instance. "access" means: 1. At which activity is the current process instance located 2. Ac
-
Aother question about SQL?
Hi, I have another question: if I exec this SQL: INSERT INTO xhealthcall_script_data (XHC_CALL_ENDED, XHC_SWITCH_PORT, XHC_SCRIPT_ID, XHC_FAX_SPECIFIED) (SELECT TO_DATE(HH_END_DATE||' '||HH_END_TIME,'MM/DD/YY HH24:MI:SS'), HH_SWITCHPORT, HH_SCRIPT,'N