Loopback, setting and update! Oh my.

Hello all, I am very new to CF and our regular guy is on taxes so I could really use some help. I get geo location of Bing for several address I have in a database. Then add the latitude and longitude for the fields of latitude and longitude of the respective row, I am able to run the indivulally functions, but I need help, loop through each line. Here's what I have. I hope that makes sense!

<! - query the db - >

< cfquery datasource = "square" name = "ListingShort" >

SELECT

MLS_Id, List_Price, Public_Address Street_Number, Street_Name, Unit_Number, city, zip_code, Subd ivision_Name, bedroom, Baths_Total, Full_Baths, Half_Baths, Square_Feet, Lot_Sqft, Garage_Capacit y, Garage_Type, High_School, Junior_School, Property_Description, Listing_Office_Name, Listing_O, ffice_Id, Listing_Agent_Name, Listing_Agent_Phone, Listing_Agent_Id, Short_Sale, Open_House_Fla g Last_Image_Update, Price_Change_Date, Image_Count, Latitude, Longitude

OF GLVAR_daily_bulk

WHERE MLS_Id = 1375233

< / cfquery >

<! - recover data from Bing - >

" < cfhttp url = ' http://dev.virtualearth.net/REST/v1/Locations/US/NV/#ListingShort.Zip_Code#/#ListingShort. City#/#ListingShort.Street_Number#%20#ListingShort.Street_Name#?o=XML & key = AgM3wR0ojSpxYaJe h6WS7p2kcckECqVQ5HkrweFcZCcyOjE3mYVvIrF_WzbETMeb"timeout ="2"method ="GET"> ".

< cfset xbinglocation = xmlparse (cfhttp.filecontent) >

< cfset xbinglocation = lat. Response.ResourceSets.ResourceSet.Resources.Location.Point.Latitude.Xml text >

< cfset = long xbinglocation. Response.ResourceSets.ResourceSet.Resources.Location.Point.Longitude.X mlText >

<! - updated the latitude and longitude fields - >

< cfquery datasource = "square" name = "addGeo" >

UPDATE glvar_daily_bulk

SET Latitude = #lat #.

Longitude = #long #.

WHERE MLS_Id = 1375233

< / cfquery >

Yo thanks. Worked perfectly. I'm sure that what was easy for you, but you saved me countless google searches! I owe you one.

Tags: ColdFusion

Similar Questions

  • "Installed" two sets of "updates" for Media Encoder and the Prime Minister today...

    Hello

    First series of paralyzed updates applications, error at start up Mac screen.

    Saw another set of updates are available for the two, tried to install them - they both failed to install.

    Logs could not install and could not start available here: https://drive.google.com/folderview?id=0B9KTofe8tAi7VlVtQkpVSlpOU0E & usp = sharing

    Thank you!

    Uninstall both clean through the use of the Adobe Creative Cloud cleaning tool to solve installation problems and reinstall using your desktop cc application.

  • Set to update to Windows 10 and now Acrobat looks terrible

    B4 I start, the forum said: 'Acrobat Installation & update questions' but once I click on it it says, it is only for "installation and update of the issues". My question is not on the installation/update, but it is a problem of installation of a sort. In addition to the fact that no other forum here is so I have no choice but to ask my question here. I hope I'm not mistaken.

    I just upgraded to Windows 10 and PDFs look awful - this is the case for my Adobe Acrobat CS 6 Pro and Adobe Acrobat Reader DC. Please note that I have no other problem of reading software on another text (or images) and that the same pdf reads fine in my browser. can anyone help? (well this forum reads gray rather than black, but maybe it's a setting I have somewhere I would guess, if it is please let me know this as well.)

    Thank you

    Hello

    I had a similar problem where the fonts showed very pixelated, after that I have upgraded to Windows 10.  For some reason any text 'smooth' set default to 'None' (Preferences > Page Display > rendering > smooth text)-I've now changed this setting to "Monitor" and it seems to have solved this problem...

    You're not sure if it's the same problem that you have experienced, but may be useful to check your Page display preferences?

  • I have to ios9.3.3 a 6s and updated iPhone and cannot retrieve old messages

    I have a 6 s iphone and updated to 9.3.3 iOS and now cannot retrieve old messages. I receive mail. I have not updated my ipad and can't receive old emails on this bequest is

    It is a POP email account? Have you set up things so that the device stores messages on the server for a certain period or until you remove them? If this isn't the case, message may have been deleted once delivered, so cannot be delivered again. See get help if you have any questions using a POP with multiple devices - Apple Support email account.

    TT2

  • Impossible to replace and update a file in the client computers through Group Policy preferences

    Hello

    I am unable to replace and update a file in the client computers through Group Policy preferences.

    For example,.

    I am trying to replace and update a custom calendar file (c:\Program Files\Microsoft Office\Office12\1033\outlook.hol)to client computers through Group Policy ptreferences (political group: computer configuration\group policy setting \file preference\windows).) But it is not updated and replaced in client computers.

    Could you please help me on this?

    THnaks

    Srinivasan

    Hello

    Your question of Windows 7 is more complex than what is generally answered in the Microsoft Answers forums. It is better suited for the public on the TechNet site. Please post your question in the following link for assistance:

    http://social.technet.Microsoft.com/forums/en/winserverGP/threads

  • When windows update is running on my machine (and updates), my screen goes down to 1024 x 768.

    When windows update is running on my machine (and updates), my screen goes down to 1024 x 768.  I have a HD card of ATI all-in - Wonder and an Acer X203H LCD with DVI connection.  If I use system restore to go back, I can get higher resolutions, but Windows does its thing and I'm back at low resolution.  I can't change the settings manually as 1024 watch as the highest res available to the general public when this happens.  There must be some weird conflicts.  I tried to update the drivers, that made no difference.  Is there a setting Aero or the conflict at stake here?  In the past, I've had trouble with a display of balnk and I had to go back to the 2008 version of the driver to get things to work.  From there, whenever I update, I can keep high resolution, but after the last windows update (security of IE8 and much smaller pack that was released on March 28-30), it dates back to 1024 x 768 again.  Control Panel and catalyst control the two show that as more high resolution available for refresh rate. Suggestions?

    Change your update settings to find the problem, we > then right-click on > hide.

    And don't do hardware drivers through Windows updates.

    Find them in the equipment or the system direct manufacturer.

    http://www.bleepingcomputer.com/tutorials/tutorial140.html

    Understanding Windows Update and Extras in Windows Vista

    Download updates but let me choose whether to install them - if you select this option, Vista will download the updates on your computer, but not install them automatically. If you want to install updates, then you must install them manually. You should only select this option if you have a reason to not install updates automatically. Only advanced users should use this option.

    Check for updates but let me choose whether to download and install them - if you select this option, you'll be alerted when there are new updates available for download and install. You can then choose to download and install the updates that you want. This option should really be reserved for people who know exactly which updates they need, or those who have little access to the Internet.

    See Update above settings to solve this problem

    See you soon.

    Mick Murphy - Microsoft partner

  • Systems build and update utility - rejects MS Action Pack OS disc

    Implemented a T105 out of the box with the tools management systems & Documentation DVD was great until it asked me to insert the disc of the operating system. I chose Windows Server 2008 Standard x 64 earlier in the wizard and inserted a DVD of the BONES of this type since a MS Partners - Action Pack set of disks. However he was rejected repeatedly by the Systems Build and Update Utility as "invalid disc".

    Anyone have ideas why this is the case? How can I advance?

    The DVD of the BONE in question has the 32-bit and 64-bit versions of Server 2008 Standard on it - this could be the reason why somehow?

    Thanks in advance for any help / lights!


  • No option to print duplex/two-face, after that I updated and updated my laptop

    I have windows 8. My laptop was not working properly so I decided to "regenerate" and update in the process. After the update, I tried to print a document from Microsoft word and printing set up for my printer was different and it didn't show me the double-sided printing option / duplex. ): How to fix this? I want to save paper. Thank you.

    You will need to go to the website of society of printer and download the printer driver for your printer.  Without this driver, only the "naked basic functions" will work.

  • How to modify and update a line later was inserted and updated in the doDML() method?

    Mr President

    Jdev worm is 12.2.1

    How to modify and update a line later was inserted and updated in the doDML() method?

    I added two rows in my table a method of action-listener in bean managed and secondly with operation doDML() as below.

    Method 1-first row in managed bean

        public void addNewPurchaseVoucher(ActionEvent actionEvent) {
            // Add event code here...
            BindingContainer bindings = BindingContext.getCurrent().getCurrentBindingsEntry();        
            DCIteratorBinding dciter = (DCIteratorBinding) bindings.get("VoucherView1Iterator");        
            RowSetIterator rsi = dciter.getRowSetIterator();        
            Row lastRow = rsi.last();        
            int lastRowIndex = rsi.getRangeIndexOf(lastRow);        
            Row newRow = rsi.createRow();        
            newRow.setNewRowState(Row.STATUS_NEW);        
            rsi.insertRowAtRangeIndex(lastRowIndex +1, newRow);         
            rsi.setCurrentRow(newRow);
            
            BindingContainer bindings1 = BindingContext.getCurrent().getCurrentBindingsEntry();        
            DCIteratorBinding dciter1 = (DCIteratorBinding) bindings1.get("VdetView1Iterator");        
            RowSetIterator rsi1 = dciter1.getRowSetIterator();        
            Row lastRow1 = rsi1.last();        
            int lastRowIndex1 = rsi1.getRangeIndexOf(lastRow1);        
            Row newRow1 = rsi1.createRow();        
            newRow1.setNewRowState(Row.STATUS_NEW);        
            rsi1.insertRowAtRangeIndex(lastRowIndex1 +1, newRow1);         
            rsi1.setCurrentRow(newRow1); 
            
            
        }
    


    Method of doDML() of line 2 seconds in the entityImpl class


        protected void doDML(int operation, TransactionEvent e) {        
            setAmount(getPurqty().multiply(getUnitpurprice()));
           
            if (operation == DML_INSERT)  
                       {          
                         insertSecondRowInDatabase(getVid(),getLineitem(),getDebitst(),
        (getPurqty().multiply(getUnitpurprice()).multiply(getStaxrate())).divide(100));  
                           }
                           
                           if(operation == DML_UPDATE)
                           {
                               
                           updateSecondRowInDatabase(getVid(),getLineitem(),getDebitst(),
        (getPurqty().multiply(getUnitpurprice()).multiply(getStaxrate())).divide(100));                        
                           }                                       
            super.doDML(operation, e);
        }
    
        private void insertSecondRowInDatabase(Object value1, Object value2, Object value3, Object value4)  
                  {  
                    PreparedStatement stat = null;  
                    try  
                    {  
                      String sql = "Insert into vdet (VID,LINEITEM,DEBITST,AMOUNT) values 
       ('" + value1 + "','" + value2 + "','" + value3 + "','" + value4 + "')";  
                      System.out.println("sql= " + sql);    
                      stat = getDBTransaction().createPreparedStatement(sql, 1);  
                      stat.executeUpdate();  
                    }  
                    catch (Exception e)  
                    {  
                      e.printStackTrace();  
                    }  
                    finally  
                    {  
                      try  
                      {  
                        stat.close();  
                      }  
                      catch (Exception e)  
                      {  
                        e.printStackTrace();  
                      }  
                    }  
                  }  
                  
                  private void updateSecondRowInDatabase(Object value1, Object value2, Object value3, Object value4)  
                  {  
                    PreparedStatement stat = null;  
                    try  
                    {  
                      String sql = "update vdet set vid='"+ value1+"',lineitem='"+ value2+"',DEBITST='" 
       + value3 + "', AMOUNT='" + value4 + "' where VID='" + VID + "'";  
                      System.out.println("sql= " + sql);      
                      stat = getDBTransaction().createPreparedStatement(sql, 1);  
                      stat.executeUpdate();  
                    }  
                    catch (Exception e)  
                    {  
                      e.printStackTrace();  
                    }  
                    finally  
                    {  
                      try  
                      {  
                        stat.close();  
                      }  
                      catch (Exception e)  
                      {  
                        e.printStackTrace();  
                      }  
                    }  
                  }
    

    Now the problem is that when later I change the quantity and price of the first line isn't updated but second row, because I used the command

     <af:button actionListener="#{bindings.Commit.execute}" text="Commit"
    

    This button update the first line added by bean managed, but the second row remains unchanged.

    Please help how to update the two lines with the same button or something else.

    Concerning

    DML_UPDATE will call only if there is some change data attributes.

    I guess that the update statement is false because vid looks like a primary key for the table, then, how update you the primary key of the update statement and how the update condition statement where the vid = '0'

    I assume the update statement should look like:

      private void updateSecondRowInDatabase(Object value1, Object value2, Object value3, Object value4)
      {
        PreparedStatement stat = null;
        try
        {
          String sql =
            "update vdet set lineitem='" + value2 + "',DEBITST='" + value3 + "', AMOUNT='" + value4 +
            "' where VID='" + value1 + "'";
          System.out.println("sql= " + sql);
          stat = getDBTransaction().createPreparedStatement(sql, 1);
          stat.executeUpdate();
        }
        catch (Exception e)
        {
          e.printStackTrace();
        }
        finally
        {
          try
          {
            stat.close();
          }
          catch (Exception e)
          {
            e.printStackTrace();
          }
        }
      }
    
  • Select the data in a table and update in another table

    Dear experts,

    create the table TB_ENCRYPT

    (

    Identification number,

    Varchar2 (200) KEY

    );

    INSERT INTO TB_ENCRYPT VALUES(1,'HJUVHDUIFBSDGVU');

    SELECT * FROM TB_ENCRYPT;

    1 HJUVHDUIFBSDGVU

    create TABLE users)

    username, NUMBER of

    password VARCHAR2 (200)

    );

    Insert users

    values (1, 123 # "")

    Insert users

    values (2, 456 #')

    Select * from users;

    1 123 #.

    # 2 456

    I want to select the data KEY for table TB_ENCRYPT column and update in the column of tables for the respective key user password

    TB_ENCRYPT table contains only a single key value. Comparing this key, I want to update the old value of the key to the new value.

    For encryption and decryption I followed the java class method.no is worried about that.

    create or replace

    PACKAGE PCK_ENC AUTHID CURRENT_USER AS

    FUNCTION DECRYPT (VARCHAR arg0, arg1 VARCHAR) AS VARCHAR BACK LANGUAGE JAVA NAME 'Encrclass.decrypt (java.lang.String, java.lang.String) return java.lang.String ';

    FUNCTION ENCRYPT (VARCHAR arg0, arg1 VARCHAR) AS VARCHAR BACK LANGUAGE JAVA NAME 'Encrclass.encrypt (java.lang.String, java.lang.String) return java.lang.String ';

    END;

    SELECT PCK_ENC. ENCRYPT('1234','HJUVHDUIFBSDGVU') FROM DUAL;

    HERE,

    1234 - is the password of the users table column data

    HJUVHDUIFBSDGVU - represents the key of table TB_ENCRYPT column data.

    Comparing this key, I want to update the old value of the key to the new value.

    I tried with this method

    declare

    cursor c1 is

    Select the key

    of TB_ENCRYPT

    where id = 1

    update the id;

    Start

    for c1_rec looping c1

    update users

    password is PCK_ENC. Encrypt (Password, Key)

    the location being c1;

    commit;

    end loop;

    end;

    /

    Help, please

    You can use the MERGE statement.

    merge into users
    using tb_encrypt
       on (id = userid)
      when matched then
          update set password = PCK_ENC.ENCRYPT(password,key);
    

    And why you encrypt your password. This isn't a good idea. Just password hash.

  • Create triggers in the table, sequence, insert and update with "model"?

    It must be of rtfm, trial and error thing but you wanted to ask, is it possible to have models or similar automation for the following scenario:

    1.), I add the table to the logic model

    2.) Using glossary I transform a relational model that was recovered / synchronized with the data dictionary

    3.) then I have the new table to add

    -but

    I would then have auto-DDL of to be synchronized to database:

    -create sequence for the id column

    -create table

    -create indexes for the id column pk

    -Create triggers for insert and update

    -l' idea is to have db_created_dt and db_modified_dt defined in the table, so that each table has them to the fields of record etc.

    -activate the triggers

    Each of them following the same naming convention.

    Similarity with approx. generator Apex workshop utils sql create table of the copy paste "excel" that creates 'id' - column + sequence and insert the trigger.

    rgrds Paavo

    Hi Paavo,

    most of the steps can be made in one or other way

    -create sequence for the id column

    -create table

    -create indexes for the id column pk

    If you want to start in the logic model and you don't want to have the ID column in the logic model and select 'Create the surrogate key' checkbox in the dialog entity - you will get an identity column in the relational model and the version of database and settings in ' preferences > Data Modeler > model > physics > Oracle "you can set the sequence generation and the trigger for taking in load.

    fields of record defined in the table, so that each table has them

    You can add the same set of columns in all tables with the transformation script 'model of Table... ».

    You can also look here Oracle SQL Developer Data Modeler 4.1 user - defined DDL generation using transformation scripts

    to see how to grant your DDL generation using the transformation script. DM comes with example to generate separate tables of logging and triggers. You can create your build script of triggers that support logging in these common columns.

    Philippe

  • in bulk accumulate in plsql and update the same table.

    Hello

    I use bulk collect and update the table that I use the slider. This table has nearly 1 million records. There will be problems with my code? Any help is greatly appreciated.

    DECLARE

    terminate_reason VARCHAR2 (1000);

    time_line NUMBER;

    limit_in NUMBER;

    CURSOR cur_violations IS

    SELECT * from abc_table;

    TYPE cur_abc_table_type IS TABLE OF cur_abc_table % ROWTYPE INDEX BY PLS_INTEGER;

    cur_abc_table_rec cur_abc_table_type;

    BEGIN

    limit_in: = 5000;

    OPEN cur_abc_table.

    LOOP

    Get the cur_abc_table COLLECT in BULK

    IN limit_in LIMIT cur_abc_table_rec;

    dbms_output.put_line ('new count is' | cur_abc_table_rec.count);

    WHEN OUTPUT cur_abc_table_rec.count = 0;

    BECAUSE me in 1... cur_abc_table_rec. Count

    LOOP

    time_line: = trunc (sysdate) - cur_abc_table_rec (i) .viol_date;

    IF (time_line > 1000)

    THEN

    terminate_reason: = 'NOTWELL. "

    ON THE OTHER

    terminate_reason: = 'PUSHED ';

    END IF;

    UPDATE abc_table v

    SET

    v.pers_terminate_reason = terminate_reason;

    END LOOP;

    END LOOP;

    COMMIT;

    CLOSE Cur_abc_table;

    EXCEPTION

    WHEN no_data_found THEN

    dbms_output.put_line ('no data is found in the selection' |) SQLERRM);

    WHILE OTHERS THEN

    dbms_output.put_line ('another error' |) SQLERRM);

    END;

    Thank you

    KK

    What happened when you tried? The sliders were ' for the update of "syntax, so there is no general problem update lines inside a loop of cursor.

    The big question you have, it is that the loop is completely and totally useless. What you can do in SQL, do in SQL - not to complicate things with PL/SQL that you don't need.

  • PSD layers and updating links

    I love the ability to InDesign to show/hide layers PSD in InDesign and especially to see the Comps of the PSD layer files.

    But InDesign seems wrong to "remember" which layers / layers to show when the updating of links.

    An example:

    Let's say that a product is available in 3 versions: black, white, and blue.

    A DSP contains a productshot in these versions of 3 color using some common and some specific color channels. A model of layer with the color name is assigned to each set of layers that displays the version of color according to.

    Now, it's easy to place the PSD in InDesign, choose 'Object layer Options' (which can contain several other layers) and set the correct layer Comp (for example: 'blue').

    I put "when update link ' to"Keep overrides the layer visibility"to ensure that InDesign remembers the appropriate color when the DSP is changed.

    Now, you feel boredom coming... Let's say an extra red color should be added. I have the Red version (including a 'red' layer comp) adds the same PSD and save it.

    To update existing links, InDesign messes layer Options existing 'object '. The black version will now see the blue, etc...

    "Layer Comp" in "Object layer Options" shows actually 'blue' while he was 'black' before the update.

    Remove the Red layer Comp and save the PSD is yet to restore the right Comp layer in InDesign.

    I used this feature often, and update links never me caused no problems so far.

    Is this a bug, or are the link to update the options for not trusting (and I just lucky in the past was)...?

    Once you use the feature, you cannot add or remove a layer or a layer comp.

    This has always been a known limit. You will find the same

    happening with Illustrator files.

  • Deleting and updating through a procedure

    Hello

    I'm a dynamic naïve for collections of Oracle & SQL concepts and always learning, here is a procedure that I wrote. First of all, it will delete the records if a version of records already exist and update dates with null, prior to their release records as the current version. Grateful if you can spot the mistakes, I think to make bulk binding when I updated but still struggling to come up with a approach, please help me with all the entries. Thank you.

    create or replace

    procedure fcs_stage_data_delete2 (p_extract_dt in varchar2, p_provider in varchar2, p_uninum in varchar2, p_ver_num in numbers, retval number)

    IS

    i_commit pls_integer: = 100000;

    i_rowcount pls_integer: = 0;

    v_code NUMBER;

    v_errm VARCHAR2 (64);

    TABLIST TYPE IS THE TABLE OF THE VARCHAR2 (20);

    TABNAME TABLIST: IS TABLIST('FEED_PROCESS_LOG','CUSTOMER','LOAN','HASH_TOTALS_FY1213');.

    Start

    --------------------------------------------------------------------------------------------------------------------------

    / * DELETION OF THE STAGE TABLES * /.

    --------------------------------------------------------------------------------------------------------------------------

    Start

    REMOVE FROM CUSTOMER_LOAN_XREF

    WHERE CUSTOMER_EXTRACT_DT = p_extract_dt

    AND CUSTOMER_PROVIDER = P_PROVIDER

    AND CUSTOMER_UNINUM = P_UNINUM

    AND CUSTOMER_VER_NUM = P_VER_NUM

    AND LOAN_EXTRACT_DT = p_extract_dt

    AND LOAN_PROVIDER = p_provider

    AND LOAN_UNINUM = p_uninum

    AND LOAN_VER_NUM = p_ver_num;

    COMMIT;

    end;

    RUN IMMEDIATELY 'ALTER TABLE CUSTOMER_LOAN_XREF DISABLE CONSTRAINT FK_CUSTOMER_LOAN_XREF_CUSTOMER;

    RUN IMMEDIATELY 'ALTER TABLE CUSTOMER_LOAN_XREF DISABLE CONSTRAINT FK_CUSTOMER_LOAN_XREF_LOAN;

    FOR I IN TABNAME. FIRST... TABNAME. LAST

    LOOP

    IMMEDIATE EXECUTION

    'REMOVE'. TABNAME (I) | »

    WHERE EXTRACT_DT =: HAS

    AND PROVIDER =: B

    AND UNINUM =: C

    "AND VER_NUM =: D"

    WITH THE HELP OF P_EXTRACT_DT, P_PROVIDER, P_UNINUM, P_VER_NUM;

    COMMIT;

    END LOOP;

    RUN IMMEDIATELY 'ALTER TABLE CUSTOMER_LOAN_XREF ENABLE CONSTRAINT FK_CUSTOMER_LOAN_XREF_CUSTOMER;

    RUN IMMEDIATELY 'ALTER TABLE CUSTOMER_LOAN_XREF ENABLE CONSTRAINT FK_CUSTOMER_LOAN_XREF_LOAN;

    -------------------------------------------------------------------------------------------------------------------------

    / * UPDATE THE PAINTINGS OF SCENE * /.

    -------------------------------------------------------------------------------------------------------------------------

    IF p_ver_num > 1

    then

    Start

    because me in (SELECT ROWID, T.* FROM FEED_PROCESS_LOG T T.EXTRACT_DT = P_EXTRACT_DT WHERE

    and T.PROVIDER = P_PROVIDER AND T.UNINUM = P_UNINUM AND T.VER_NUM = P_VER_NUM-1)

    loop

    UPDATE FEED_PROCESS_LOG SET ACT_END_DT = NULL, UPDATE_ID = NULL, UPDATE_DT = NULL WHERE ROWID = I.ROWID;

    end loop;

    commit;

    end;

    Start

    for i in (SELECT ROWID, T.* FROM CUSTOMER T WHERE T.EXTRACT_DT = p_extract_dt and T.PROVIDER = P_PROVIDER

    AND T.UNINUM = P_UNINUM AND T.VER_NUM = P_VER_NUM-1)

    loop

    UPDATE CUSTOMER SET ACT_END_DT = NOTHING WHERE ROWID is i.ROWID;.

    end loop;

    commit;

    end;

    end if;

    retval: = 0;

    exception, then than others

    then

    v_code: = SQLCODE;

    v_errm: = SUBSTR (SQLERRM, 1, 64);

    retval: = 1;

    end fcs_stage_data_delete2;

    I'm talking about the loops that do updates, not deletions.

    Bulk collect a bunch of SQL UPDATE of ROWID instructions just use directly.

    I compared the time taken with and "bulk collect" and I see better performance when I bulk collect and update.

    Sorry - I don't believe you. I don't see anything in BULK COLLECT (which were not yet made you in the first code you posted) may possibly be faster than an update SQL statement.

    Most collect must search for lines, download the ROWID, create a collection and then move this collection to the SQL engine to make the update

    An UPDATE to SQL finds the lines and then did the update. It does not use the PL/SQL, a collection or get the collection back.

    Summary - COLLECTION BULK actually what does the SQL UPDATE and more.

    The new code in BULK COLLECT you posted also has two major problems in it.

    First of all there is no LIMIT clause to limit the amount of memory of expensive PGA which is used.

    In the second place, because there is no LIMIT clause, there not need all of the loop.

    Just use an SQL UPDATE statement that removes lines based on the WHERE clause you are currently using to find the ROWID.

  • Importing a flat at Oracle and update another table

    Hey everybody,

    I am a newbie with Oracle, and I tried for 2 days to fix this below. But all my research and all attempts have failed.

    I have a text file called ReturnedFile.txt. This is a comma separated text file that contains the records of two fields... Envelope and Date returned.

    At the same time, I have a table in Oracle called manifest. This table contains the following fields:

    Envelope

    DateSentOut
    DateReturned

    I need to write something that matter the ReturnedFile.txt in a temporary Oracle table named UploadTemp and compares the data in the field of the envelope of UploadTemp with the domain of the envelope in the manifest. If it is a match, then the field of clear needs updated with field DateReturned in UploadTemp DateReturned.

    I did it with SQL Server without problem, but I tried for two days to make it work with Oracle and I can't understand it. I tried to use SQL * Loader, but I can not even run properly on my machine.

    I create a file of control, registered as RetFile.ctl. Here is the content of the CTL file:

    DOWNLOAD THE DATA
    INFILE 'C:\OracleTest\ReturnedFile.txt '.

    ADD
    IN THE UploadTemp TABLE
    "FIELDS TERMINATED BY '"
    (
    ENVELOPE,
    DATERETURNED
    )

    If I could get SQL * Loader works, here's the code I came with to import the text file, then compare it to the clear table and update if necessary:

    sqlldr UserJoe/Password123 CONTROL=C:\OracleTest\RetFile.ctl LOG = RetFile.log BAD = RetFile.bad

    update the manifest m set m.DateReturned =
    (select t.DateReturned
    of UploadTemp t
    where m.Envelope = t.Envelope
    *)

    That's all I had. As I said, I can't find a way to test it and I have no idea if it's still close.

    Please... can anyone help me? Even close, I'm on this thing?

    Joe

    If your ReturnedFile.txtfile is a comma, you must FINISH BY ',' not COMPLETED BY "'" in your control file.  If it happens to not be a comma ending on a line, then you must also add TRAILING NULLCOLS in your control file.  You must also use a date format for your date in your control file that corresponds to the date format in your file ReturnedFile.txt, where it does not match the format of the date on your system.  You must add a WHERE EXISTS clause in your update statement to prevent any lines that do not have the updated DateReturned with a null value.  Please see the example below.  If it doesn't then please do a copy and paste as I did, that includes a few lines of sample data and table structure.  It would also be useful to see your SQL * Loader or logs SQL * Loader error message.  If you can not get SQL * Loader is running properly, then you may have other issues, such as the permissions of files at the operating system level.  Also, there are options other than the methods below.  For example, you can use an external table, instead of SQL * Loader, if your ReturnedFile.txtfile is on your Serer, not your client.  You can also use the merger instead of update.

    Scott@orcl_11gR2 > type host returnedfile.txt

    enV2, 07/03/2013

    ENV3, 07/04/2013

    ENV4, 07/05/2013

    Scott@orcl_11gR2 > type host retfile.ctl

    DOWNLOAD THE DATA

    INFILE 'ReturnedFile.txt '.

    ADD

    IN THE UploadTemp TABLE

    FIELDS TERMINATED BY ', '.

    trailing nullcols

    (ENVELOPE

    DATERETURNED date "yyyy-mm-dd")

    Scott@orcl_11gR2 > create table uploadtemp

    2 (envelope varchar2 (15),)

    date of datereturned 3)

    4.

    Table created.

    Scott@orcl_11gR2 > create clear table

    2 (envelope varchar2 (15),)

    3 date of DateSentOut,

    4 date of DateReturned)

    5.

    Table created.

    Scott@orcl_11gR2 > insert all

    2 in manifests values ("env1", sysdate-7, sysdate-3)

    3 in obvious values ("env2", sysdate-6, null)

    4 in the obvious values ('env3' sysdate-5, null)

    5 Select * of the double

    6.

    3 lines were created.

    Scott@orcl_11gR2 > select * from manifest

    2.

    ENVELOPE DATESENTO DATERETUR

    --------------- --------- ---------

    ENV1 June 28, 13 2 July 13

    enV2 29 June 13

    ENV3 30 June 13

    3 selected lines.

    Scott@orcl_11gR2 > host sqlldr scott/tiger CONTROL = RetFile.ctl LOG = RetFile.log BAD = RetFile.bad

    SQL * Loader: release 11.2.0.1.0 - Production on Fri Jul 5 13:15:06 2013

    Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

    Commit the point reached - the number of logical records 3

    Scott@orcl_11gR2 > select * from uploadtemp

    2.

    ENVELOPE DATERETUR

    --------------- ---------

    enV2 3 July 13

    ENV3 4 July 13

    ENV4 July 5, 13

    3 selected lines.

    Scott@orcl_11gR2 > clear day m

    2. set m.DateReturned =

    3 (select t.DateReturned

    4 t UploadTemp

    5 where m.Envelope = t.Envelope)

    6 where there is

    7 (select t.DateReturned

    UploadTemp 8 t

    9 where m.Envelope = t.Envelope)

    10.

    2 lines to date.

    Scott@orcl_11gR2 > select * from manifest

    2.

    ENVELOPE DATESENTO DATERETUR

    --------------- --------- ---------

    ENV1 June 28, 13 2 July 13

    enV2 June 29, 13 3 July 13

    ENV3 June 30, 13 4 July 13

    3 selected lines.

Maybe you are looking for