What is optimize way of doing this

Hi
I have following tables
T1
Part number
Model Year
Program
Lead Program
sample data:
123 P1 1978 N
123 P1 1977 N
123 P2 1978 N
T2
Program
Model Year
Active flag
sample data:
P1 1978 Y
P1 1977 Y
P2 1978 Y
T3
Program
Model Year
Date
sample data:
P1 1978 12/10/2006
P1 1977 20/10/2008
P2 1978 30/10/2007
Processing Steps:
1. Identify all Distinct Part Numbers from T1
2. For each Part Number , Find all Distinct (Program Model, Year)
3. From T2, identify and remove inactive records with (Program Model, Year) combination
4. For all active (Program Model, Year), extract date from T3
5. Identify one (Program Model, Year) combination with min date.
6. For all records from T1 , matching individual distinct part number, update Lead Program to Y for (Program Model, Year) identified in step 5.
I was thinking about
a. define cursor for 1st step
b. for each part in cursor , will execute join qry for 2,3,4 (on T1,T2,T3) & store results in temp table
c. Include rownum condition in above qry to return one program,model year with min date
d. update lead pgm field in T1 for corresponding program, model year combn
Can anybody suggest any other way of optimizing this?I feel since my first cursor may contain thousands/millions of record, will there be any performance problem?

Safari > Preferences > Security > Enable Java

Similar Messages

  • I want to connect a Mac mini to a Samsung 40", Whats the best way to do this?

    I want to connect a Mac mini to a Samsung 40" LED tv to use as the monitor, whats the best way of doing this?

    Understand that there is one HDMI port on your TV that is specifically designated for PC connectivity. The order that the TV or Mini are powered on may determine your results. For your specific TV model, check buyer reviews on Amazon or elsewhere that can include optimum TV/Computer settings adjustment for improved viewing results.

  • Is there a better way of doing this? (multifileupload/forms/mysql)

    Hi all.
    I've managed to cobble together a page that will let me upload three files paths and three text boxes to a mysql database. the the files also go to specific directories depending on conditions.
    what im looking for is to see if there is a more efficient way of doing this. im mainly looking at the value and name strings along with the preparedstatement insert. i'd like to see if i can make it more dynamic so i don't have to predefine an amount anywhere.
    This code is working as is if anyone wants to use it in it's current state.
    here is the form
    <HTML>
      <HEAD>
        <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1252"/>
        <TITLE>File Upload Page</TITLE>
      </HEAD>
      <BODY>Upload Files
        <FORM name="filesForm" action="uploadTestProccess.jsp" method="POST" enctype="multipart/form-data">
            File 1:<input type="file" name="file1"/><br/>
                File 2:<input type="file" name="file2"/><br/>
            File 3:<input type="file" name="file3"/><br/>
              text4: <input type="text" name="textField4" value="this is a test4"><br>
              text5: <input type="text" name="textField5" value="this is a test5"><br>
              text6: <input type="text" name="textField6" value="this is a test6"><br>
            <input type="submit" name="submit" value="Upload Files"/>
        </FORM>
      </BODY>
    </HTML>and here is the insert
    <%@ page contentType="text/html;charset=windows-1252"%>
    <%@ page import="org.apache.commons.fileupload.DiskFileUpload"%>
    <%@ page import="org.apache.commons.fileupload.FileItem"%>
    <%@ page import="org.apache.commons.fileupload.*"%>
    <%@ page import="java.util.List"%>
    <%@ page import="java.util.Iterator"%>
    <%@ page import="java.io.File"%>
    <%@ page import="java.sql.*"%>
    <%!
    String value4;
    String value5;
    String value6;
    String name1;
    String name2;
    String name3;
    String dir;
    Connection dbconn;
    ResultSet result;
    %>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    </head>
    <%
            //System.out.println("Content Type ="+request.getContentType());
            DiskFileUpload fu = new DiskFileUpload();
            // If file size exceeds, a FileUploadException will be thrown
            fu.setSizeMax(10000000);
            List fileItems = fu.parseRequest(request);
            Iterator itr = fileItems.iterator();
         for(int i=1; itr.hasNext(); i++){
                FileItem fi = (FileItem)itr.next();
                //Check if not form field so as to only handle the file inputs
                //else condition handles the submit button input
              if(!fi.isFormField()) {
                  out.print(i);
                //out.println("\nNAME: "+fi.getName());
                //out.println("SIZE: "+fi.getSize());
                   if(i==1){
                        name1 = fi.getName();
                        dir = "file1/";
                   } else if (i==2){
                        name2 = fi.getName();
                        dir = "file2/";
                   } else {
                        name3 = fi.getName();
                        dir = "file3/";
                File fNew= new File(application.getRealPath("examples1/" + dir), fi.getName());
                //out.println(fNew.getAbsolutePath());
                fi.write(fNew);
                   out.print("success<br>" + fi.getName() + "<br>");
                  } else {
                     //gets field names and values
                  // out.println("Field ="+fi.getFieldName());
                     String name      = fi.getFieldName();
                   if(i==4){
                        value4 = fi.getString();
                   } else if (i==5){
                        value5 = fi.getString();
                   } else if (i==6) {
                        value6 = fi.getString();
                   String value = fi.getString();
                    out.println("Found field with name <b>"+ name +"</b> and value <b>"+ value  +"</b><br>");
                   Class.forName("org.gjt.mm.mysql.Driver");
                   dbconn = DriverManager.getConnection("jdbc:mysql://localhost:3306/xxx?user=root&password=xxx");
                   PreparedStatement sql = dbconn.prepareStatement("INSERT INTO uploadtest (file1, file2, file3, four, five, six) VALUES (?,?,?,?,?,?)");
                   sql.setString(1, name1);
                   sql.setString(2, name2);
                   sql.setString(3, name3);
                   sql.setString(4, value4);
                   sql.setString(5, value5);
                   sql.setString(6, value6);
                   int result = sql.executeUpdate();
              %>
    <body>
    <!--Upload Successful!!-->
    </body>
    </html>

    anyone?

  • My iPhone 4S will not connect to the internet properly. It says that it is connected, the App Store won't load apps and I can't get on my face book app. I have tried wifi and my cellular data, neither work. What are some ways to fix this?

    My iPhone will
    not connect to the internet properly. It says that it is connected, the App Store won't load apps and I can't get on my face book app. I have tried wifi and my cellular data, neither work. What are some ways to fix this?

    Try resetting your network settings.
    Settings>Genenal>Reset>Reset Network Settings.

  • I have two apple accounts and one of which has my music on. I would like to move this music to the other account. Is there a simple way of doing this?

    I have two apple accounts and one of which has my music on. I would like to move this music to the other account. Is there a simple way of doing this?

    There is currently no way to merge accounts.  The best option is to pick one, and use it consistantly.
    HTH.

  • HI, I recently upgraded my operating system IOS 5.0.1 on an iphone 3gs. MY question is, how do I get the text messaging preview to just pop up so that I can see the name only when the lock screen is on? The conventional ways of doing this aren't working

    HI, I recently upgraded my operating system IOS 5.0.1 on an iphone 3gs. My question is, how do I get the text messaging preview to just pop up so that I can see the name only when the lock screen is on? The conventional ways of doing this, such as using turning off the SMS preview under the "passcode lock", well that option no longer exists, or if it does, I'm somehow missing it.
    When I go to the "messages" setting under settings on my phone, I still don't see an option of turning it off.
    If I can just get the name of the person sending the message, as I had it before, I'd be happy.
    Help!

    That option still exists in Settings > Notifications > Messages > Show Prview (OFF) and View in Lock Screen (ON). Here's how to configure your Notifications and Notification Center for iOS 5: http://iphone-and-i.blogspot.com/2012/01/how-to-customize-notification-center-in .html

  • Good day actually i purchase second hand iphone from Swiss and we i try to open it in Egypt the phone showing it's locked as it was working in Swiss, so no one will help me like Apple it self just i want to know what is the way to fix this issue please?

    good day actually i purchase second hand iphone from Swiss and we i try to open it in Egypt the phone showing it's locked as it was working in Swiss, so no one will help me like Apple it self just i want to know what is the way to fix this issue please?

    You need to find out who the carrier was in Switzerland and see if they will unlock the device. The carrier with the lock is the only one that can authorize the unlock. You may need to check with the original owner and see if they can get it unlocked by the carrier if you do not qualify.

  • I would like to duplicate the folders and apps that I have set up on my iPhone to my iPad.  Is there a quick way of doing this without going through the whole process again manually?

    I would like to duplicate the folders and apps that I have set up on my iPhone to my iPad.  Is there a quick way of doing this without going through the whole process again manually?

    You can restore your iPad with your iPhone backup but items that are iPhone only will not transfer.  It should recreate all your folders.  It can't hurt anything to try.

  • I want to run Quicken through Windows on my macbook pro, whats the best way to do this?

    I want to run Quicken 2012 through Windows on my macbook pro, whats the best way to do this?
    I have been looking at Parallels or VMware in order to use Windows but then I will also need to get a Windows license. Just looking for the most inexpensive way possible as this will probably be the only Windows app I run.
    Also looking at this CrossOver software which says you dont need Windows license. Anyone used this before? had success?

    CrossOver's website has a list of software it has certified as working or working with known issues - Quicken 2012 has a bronze rating meaning it runs but with enough issues that it isn't recommended. In other words, "Run away!"
    Get a copy of Windows 7 OEM from Amazon or New Egg and give it a try with VirtualBox (an open source virtualization program). If VirtualBox doesn't cut it you can always buy VMWare or Parallels.

  • Is it possible to copy a DVD into iTunes and then upload it to my iPad? Is there any way of doing this?

    Is it possible to copy a DVD into iTunes and then upload it to my iPad? Is there any way of doing this?

    Sure, just use Handbrake to encode the DVD movie into a format that is playable on iTunes and on your iPad:
    http://handbrake.fr/downloads.php
    Once the encoding is complete, move the movie file from your desktop into iTunes and then sync your iPad.  Presto, the movie is on your iPad!

  • My business has 100 ipads 3g with no control at the moment - i need to now control the ipads - what apps they can use - and restict certian use on the ipads - whats the best way to do this - it will need to be done remotley.

    my business has 100 ipads 3g with no control at the moment - i need to now control the ipads - what apps they can use - and restict certian use on the ipads - whats the best way to do this - it will need to be done remotley.

    MDM  -- moble device management 
    MDMs
    Airwatch, Meraki, MobileIron, Profile Manager on OS X Server, or Zenprise
    For a comparison see this page:
    http://www.enterpriseios.com/wiki/Comparison_MDM_Providers
    Airwatch
      http://www.air-watch.com/
    Meraki -- A free MDM   [ expect lots of email and phone calls about upgrades ]
      http://www.meraki.com/products/systems-manager/
      https://discussions.apple.com/thread/4067210?tstart=0
      Good howto by Sergio Sosa.
      https://discussions.apple.com/thread/2594001?start=15&tstart=0
    MobileIron
      http://www.mobileiron.com/
    Profile Manager by Apple
    Zenprise
      http://www.zenprise.com/

  • HT4413 I want to transfer about three thousand photos on my MacAir to my iMac. Any suggestions on the best way of doing this?

    I want to transfer about three thousand photos on my MacAir to my iMac. Any suggestions on the best way of doing this?

    Are the photos in iPhoto?
    If they are, you can simply copy your iPhoto Library (located in your Pictures folder) to a thumb drive or external drive and then copy it over to your other Mac. This will only work if the iMac has the same version (or later version) of iPhoto as does the Macbook Air.  Then on the iMac, if you want to combine this new library with the existing one over there, use iPhoto Library Manager (a free download program).
    If you want to copy over only a portion of that iPhoto library, iPhoto Library Manager can create a smaller library containing just the photos you want to include. Then copy that smaller library.

  • HT1689 Hey live in us but wanting to download an album on iTunes, but they only have in Ireland iTunes Store. What's a way to get this album short of moving to Ireland and setting up a bank account?

    Hey live in us but wanting to download an album on iTunes, but they only have in Ireland iTunes Store. What's a way to get this album short of moving to Ireland and setting up a bank account?

    You can try requesting that it be added to the US store, but ultimately it's the record company that will have to grant Apple a license to sell it there : http://www.apple.com/feedback/itunes.html
    Is it available on any other music purchase download sites that you have access to ?

  • Please help!!! Need another way of doing this!!

    Hello i was wondering if someone could help me with this. I am sure there could be a different way of doing this. Maybe setting up an arraylist or an array and searching through it until the selected item in the combo Box is equal to the item in the array
    list??
    //MY CODE
     private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
                if (comboBox1.SelectedItem == "Toyota")
                { string file = "txtFiles/toyotaModel.txt"; string send = rModelInfo(file); }
                else if (comboBox1.SelectedItem == "Ford")
                { string file = "txtFiles/fordModels.txt"; string send = rModelInfo(file); }
                else if (comboBox1.SelectedItem == "Hyundai")
                { string file = "txtFiles/hyundaiModels.txt"; string send = rModelInfo(file); }
                else if (comboBox1.SelectedItem == "Chevrolet")
                { string file = "txtFiles/chevroletModels.txt"; string send = rModelInfo(file); }
                else if (comboBox1.SelectedItem == "Honda")
                { string file = "txtFiles/hondaModels.txt"; string send = rModelInfo(file); }
                else if (comboBox1.SelectedItem == "Dodge")
                { string file = "txtFiles/toyotaModel.txt"; string send = rModelInfo(file); }
                else if (comboBox1.SelectedItem == "Ram")
                { string file = "txtFiles/toyotaModel.txt"; string send = rModelInfo(file); }
                else if (comboBox1.SelectedItem == "Nissan")
                { string file = "txtFiles/toyotaModel.txt"; string send = rModelInfo(file); }
                else if (comboBox1.SelectedItem == "Kia")
                { string file = "txtFiles/toyotaModel.txt"; string send = rModelInfo(file); }
                else if (comboBox1.SelectedItem == "Mazda")
                { string file = "txtFiles/toyotaModel.txt"; string send = rModelInfo(file); }
                else if (comboBox1.SelectedItem == "GMC")
                { string file = "txtFiles/toyotaModel.txt"; string send = rModelInfo(file); }
                else if (comboBox1.SelectedItem == "Volkswagen")
                { string file = "txtFiles/toyotaModel.txt"; string send = rModelInfo(file); }
                else if (comboBox1.SelectedItem == "Jeep")
                { string file = "txtFiles/toyotaModel.txt"; string send = rModelInfo(file); }
                else if (comboBox1.SelectedItem == "Subaru")
                { string file = "txtFiles/toyotaModel.txt"; string send = rModelInfo(file); }
                else if (comboBox1.SelectedItem == "Mercedes-Benz")
                { string file = "txtFiles/toyotaModel.txt"; string send = rModelInfo(file); }
                else if (comboBox1.SelectedItem == "BMW")
                { string file = "txtFiles/toyotaModel.txt"; string send = rModelInfo(file); }
                else if (comboBox1.SelectedItem == "Chrysler")
                { string file = "txtFiles/toyotaModel.txt"; string send = rModelInfo(file); }
                else if (comboBox1.SelectedItem == "Mitsubishi")
                { string file = "txtFiles/toyotaModel.txt"; string send = rModelInfo(file); }
                else if (comboBox1.SelectedItem == "Audi")
                { string file = "txtFiles/toyotaModel.txt"; string send = rModelInfo(file); }
                else if (comboBox1.SelectedItem == "Acura")
                { string file = "txtFiles/toyotaModel.txt"; string send = rModelInfo(file); }
                else if (comboBox1.SelectedItem == "Lexus")
                { string file = "txtFiles/toyotaModel.txt"; string send = rModelInfo(file); }
                else if (comboBox1.SelectedItem == "Buick")
                { string file = "txtFiles/toyotaModel.txt"; string send = rModelInfo(file); }
                else if (comboBox1.SelectedItem == "Infinity")
                { string file = "txtFiles/toyotaModel.txt"; string send = rModelInfo(file); }
                else if (comboBox1.SelectedItem == "Cadillac")
                { string file = "txtFiles/toyotaModel.txt"; string send = rModelInfo(file); }
                else if (comboBox1.SelectedItem == "Fiat")
                { string file = "txtFiles/toyotaModel.txt"; string send = rModelInfo(file); }
    And this si where i am using the "File" variable
     // Opens Models file depending on The "Get" string. Also Storing the Stored txt data into Array list
            StreamReader objReaderFour = new StreamReader(get);
            string sLineFour = "";
            ArrayList Models= new ArrayList();
            while (sLineFour != null)
                sLineFour = objReaderFour.ReadLine();
                if (sLineFour != null)
                    Models.Add(sLineFour);
            objReaderFour.Close();
            // converting arraylist into array
            String[] hhModels = (String[])Models.ToArray(typeof(string));
            comboBox2.Items.AddRange(hhModels);

    Personally I like this one the most.
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Windows.Forms;
    namespace WindowsFormsApplication1
    public partial class Form1 : Form
    public Form1()
    InitializeComponent();
    private BindingList <CarLink> CarLinks = new BindingList<CarLink>();
    private void Form1_Load(object sender, EventArgs e)
    CarLinks.Add(new CarLink() {Name="Buick", Link = "Whatever"});
    CarLinks.Add(new CarLink() {Name = "BMW", Link = "Whatelse" });
    comboBox1.DataSource = CarLinks;
    comboBox1.DisplayMember = "Name";
    comboBox1.ValueMember = "Link";
    comboBox1.SelectedIndexChanged += new System.EventHandler(Selected_indexchanged);
    public class CarLink
    public string Name {get;set;}
    public string Link {get;set;}
    private void Selected_indexchanged(object sender, EventArgs e)
    MessageBox.Show(comboBox1.SelectedValue.ToString());
    Success
    Cor

  • I have 91 file that are pdfs i need to make searchable what is the best way of doing this

    help
    i have 91 file that are pdfs i need to make searchable what is the best way of doing this

    Hi ismaelr61128862,
    I would recommend you to try Advanced search option of Acrobat software, Go to Edit and then Advanced search.
    Hope that helps. In case you have any further questions please provide sufficient amount of details so that i can assist you more accurately.
    Regards,
    Rahul

Maybe you are looking for

  • I can open Gmail; but when I try to open Calendar it says it is unable to do so due to cookies. What?!?

    When I'm in Gmail and I try to open my Calendar, an error report opens instead. It says: Firefox has detected that the server is redirecting the request for this address in a way that will never complete. * This problem can sometimes be caused by dis

  • IPod Classic being recognised but not syncing when prompted?

    My iPod Classic is apparently running the latest iPod software, and I've just updated iTunes to the most recent version but I'm having the same problem I've had with another laptop. The laptop recognises the iPod, and shows it up in iTunes. I press S

  • CLIENT point of view

    I am a SAP BW consultant just started and willing to learn from Other expereiences. I want to know certain things which might have occured to so many of you 1. In an ERP environment,  How SAP BW migration from other External Data Warehouses will bene

  • ShareDocuments between user group

    Hi Guys, I have setup intranet sharepoint portal . I have 3 permission group like 1) Full access 2) Contributor 3) Read-only Access and users have been added to all these group. Now my question is if admin has uploaded the document, checkin and appro

  • [Solved] Removing "Recently Used" and "Search" Entries from Open/Save

    Each time I save or open a document, the dialog box defaults to "Recently Used". What I'm wanting to find out is how to get rid of the entry from the "Places" bar altogether. I understand that the entry was put there with good intentions, but it seem