How to run an update query on results from a spreadsheet

Hey there,
I am new to this kinda thing.
I received a spreadsheet that has 2 tabs, 1 is called SQL Results, and has a ton of data. 1 is called SQL Statement and has a select statement in the first cell.
I was told to run an update query using the spreadsheet, and was given this:
= CONCATENATE("Update CARDMEMBERISSUE set CURRSTATUSCD = 'ACT', DATELASTMAINT = sysdate where AGREENBR = ",A2," and MEMBERNBR = ",B2," and ISSUENBR = ",C2,";")
= CONCATENATE("Insert into CARDMEMBERISSUEHIST (AGREENBR, MEMBERNBR, ISSUENBR, EFFDATETIME, CARDSTATCD, STATREASON, DATELASTMAINT, DATESENT) values (",A2,",",B2,",",C2,",sysdate,'ACT',null,sysdate,null);"
I am not sure what to do or how to run this.
This is the what the lines in the spreadsheet look like, including column header, A1 is blank.
A B C etc
     AGREE NBR      MEMBERNBR ISSUE NBR CURRSTATUSCD PREFIX CARD NBR AGREETYPCD OWNER PERS NBR     EXT CARD      ISSUE DATE     
2     12          1     44     ISS g     22 22 19/10/2011

The =concatenate bits are Excel formulae. Assuming they correctly written, they will generate a set of individual sql statements. The first concaenatewill generate a set of update statements against the CardMemberIssue table, and the seond will generate a set of insert statement to the CardMemberIssueHist table.
You should be able to just paste the generated statements into whatever tool you are using to run sql to execute them. Before you do that though, make sure that you issue:
alter session set cursor_sharing=force;before pasting anything in.
john

Similar Messages

  • Update Query with Results From another Procedure

    I am not sure if you can do this or what the proper format of the command might look like.
    I have a stored procedure which insert records into a database. I want to insert the records which are returned by calling another procedure. This other procedure returns a cursor object to a variable named o_rows. Can this be done using Oracle 8i?
    Insert into MyTable
    MyStoredProcedure(oRows);

    You have a couple of options.
    1) You can turn your stored procedure into a pipelined table function. This would allow you to do something like
    INSERT INTO myTable
      SELECT *
        FROM TABLE( myStoredProcedure() );I don't believe that pipelined table functions were available in 8i, however.
    2) The other option would be to fetch rows from the cursor and insert those into your table. Something like
    LOOP
      FETCH oRows INTO col1, col2, col3, col4, ...
      INSERT INTO myTable( <<column list>> )
        VALUES( col1, col2, col3, col4 );Note that for simplicity I am omitting the declarations of the local variables col1, col2, etc. and the check to see whether the cursor was exhausted.
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • How to run a search query for a particular folder in KM related to portal

    Hi,
    Can any one tell me the steps for : how to run a search query for a particular folder in knowledge management related to portal.
    Answers will be rewarded.
    Thanks in advance.
    KN
    Edited by: KN on Mar 18, 2008 6:33 AM

    Ok u may not require a coding
    But u req configuration
    U should first make a search option set
    Link: [Search Option set|http://help.sap.com/saphelp_nw04/helpdata/en/cc/f4e77ddef1244380b06fee5f8b892a/frameset.htm]
    Then u need 2 duplicate a KM Command by the name Search From here
    and customize it to include the Search Option that u have created
    Link: [Search from here|http://help.sap.com/saphelp_nw04/helpdata/en/2a/4ff640365d8566e10000000a1550b0/frameset.htm]
    Then in the layout add this command.
    Regards
    BP

  • My one DAG fail then how to run e-mails in my organisation from another DAG that is located another Location.

    Hi
    DAG Failed then how to run e-mails in my organisation from another DAG.
    means the another DAG work automatically or i will do something for outside the DAG.
    Regards
    Anil kumar Gangwar

    Hi,
    In order to resolve the problem more efficiently, I need to clarify some information.
    1. Do you have two AD sites in your environment?
    2. If you have two AD site, do you have active users in these two AD sites?
    3. Does each AD site have a DAG which is cross-site?
    Best regards,
    Belinda
    Belinda Ma
    TechNet Community Support

  • How to run a remote application (Non Java) from a Java program

    Could you please tell me how to run a remote application (Non-Java) from a Java program without using RMI. Please tell me know the procedure and classes to be used.
    Cheers
    Ram

    what do you mean remote application.In the other pc or in your pc just apart from you application?
    If the application is in your pc,the method which the upper has mentioned is
    a good one!
    But if the application you want to run is not in your computer,the method can't do. And you can use socket with which you can build an application listening some port in the pc which contains the application you want to run .When you want to run that application ,send the Start_Command to the listening application.Then listening application will run the application with the help of the method the upper mentioned.

  • How to Run a Select Query  stored in a Variable

    Hello,
    I have a following requirement:
    Result of one select query on Var1 , result of other select query in Var2 ,
    if Va2 = 'value11' OR Var2 = 'Value2' then Var1 = 'select query'. Now how can I run this SQL query at the end of the Pl/SQL?
    so I'm writing following query for the same:
    DECLARE
    qry nvarchar2(500);
    result nvarchar2(500);
    BEGIN
    select 'select TEXTVAL as "CHARG" FROM TABLE1 WHERE LOC =''[ParameterValue]'' and KEYNAME =''<<REPLACE>>''' INTO qry from dual;
    SELECT CASE WHEN count(RW."CountofBATCH") > 1 then 'Mixing'
    WHEN count(RW."CountofMAT") = 0 then 'None'
    ELSE 'Other'
    END
    INTO result
    FROM TABLENAME2 TT, XMLTable('/Rowsets/Rowset/Row' PASSING TT.XMLCOL
    COLUMNS
    "CountofBATCH" PATH '/Row[CLABS > 0]/CHARG',
    "CountofMAT" PATH '/Row[MATNR = "[Parameter Value]"]/MAT'
    ) AS RW
    where
    TT.PL = '[Parameter Value]' and
    TT.TANK = '[Parametr Value]' ;
    IF result = 'Mixing' OR result = 'None' THEN
    qry := replace( qry , '<<REPLACE>> ' , result);
    else
    qry := 'Nothing';
    END IF;
    This way the variable qry will have select statement. Now How can I run this qry variable to get the output of that select statement in the same query?

    you can use execute immediate if the output of the query is in the single query.
    that is very simple.
    have the query in the signle string and then pass like this
    declare
    qry varchar2(255);
    result varcharf2(2500);
    vempid number :=1;
    begin
    qry:='select empname from emp where empid=:empid';
    execute immediate qry into result using vempid;
    -----now the data result is in result
    end;

  • How to execute a update query when the particular date changes

    hi all,
    i am using date base 11.1.0.6.0,
    i am trying a small update query it should fire when particular date changes in year.
    i think for trigger but i didn't get how to execute it.
    Regards,
    Pavan

    Hi, Pavan,
    Use dbms_scheduler to run a procedure at a given time (or at repeatedly, at given times).
    A trigger is good for re-acting to certain actions in the database, someone INSERTing a row in a given table, for example. Nothing will necessarily be happening when you want your procedure to run, so a trigger is not good in this case.

  • How to run a WMI query to get an element of a class?

    Hello everyone,
    I am trying to run a PowerShell Query to get the value of a certain element inside a class instance. How can I accomplish this?
    I tried this...
    PS C:\windows\system32> Get-WmiObject DCIM_BIOSPassword -Namespace ROOT\DCIM\SYSMAN | Select AttributeName,IsSet
    AttributeName                                                                 IsSet
    AdminPwd                                                                       True
    SystemPwd                                                                     False
    and I get the result of both instances; (Because there are two instances inside the class!) I want the result of just one instance.
    Thank you very much in advance.

    This is the result I get;
    PS C:\windows\system32> Get-WmiObject DCIM_BIOSPassword -Namespace ROOT\DCIM\SYSMAN | Get-Member
    TypeName: System.Management.ManagementObject#ROOT\DCIM\SYSMAN\DCIM_BIOSPassword
    Name MemberType Definition
    PSComputerName AliasProperty PSComputerName = __SERVER
    AttributeName Property string AttributeName {get;set;}
    Caption Property string Caption {get;set;}
    CurrentValue Property string[] CurrentValue {get;set;}
    DefaultValue Property string[] DefaultValue {get;set;}
    Description Property string Description {get;set;}
    ElementName Property string ElementName {get;set;}
    InstanceID Property string InstanceID {get;set;}
    IsOrderedList Property bool IsOrderedList {get;set;}
    IsReadOnly Property bool IsReadOnly {get;set;}
    IsSet Property bool IsSet {get;set;}
    MaxLength Property uint64 MaxLength {get;set;}
    MinLength Property uint64 MinLength {get;set;}
    PasswordEncoding Property uint32 PasswordEncoding {get;set;}
    PendingValue Property string[] PendingValue {get;set;}
    __CLASS Property string __CLASS {get;set;}
    __DERIVATION Property string[] __DERIVATION {get;set;}
    __DYNASTY Property string __DYNASTY {get;set;}
    __GENUS Property int __GENUS {get;set;}
    __NAMESPACE Property string __NAMESPACE {get;set;}
    __PATH Property string __PATH {get;set;}
    __PROPERTY_COUNT Property int __PROPERTY_COUNT {get;set;}
    __RELPATH Property string __RELPATH {get;set;}
    __SERVER Property string __SERVER {get;set;}
    __SUPERCLASS Property string __SUPERCLASS {get;set;}
    ConvertFromDateTime ScriptMethod System.Object ConvertFromDateTime();
    ConvertToDateTime ScriptMethod System.Object ConvertToDateTime();
    But this is not it. I want to get the value of "IsSet" for AdminPwd only.

  • How to right an update query in oracle using two tables?

    Table1
    ID     Dept
    1     A
    2     B
    3     A
    4     B
    5     C
    6     A
    7     D
    Table2
    ID     Dept
    1     A
    2     B
    3     A
    4     B
    5     C
    6     A
    7     D
    How to update id in Table1 from Table2 on joining condition Table1.dept=Table2.dept
    in Oracle

    869357 wrote:
    No it's not running, giving some error.That is because SQL server construct is different than that of Oracle.
    Try with
    update table1 a set a.id = (select min(b.id) from table2 b where a.dept = b.dept);
    However, due the repeated department values will not give you the desired output.

  • ınstructıons on how to run the updater

    I am on a vacatıon ın Turkey and whıle I was really enjoyıng my musıc last nıght ıt suddenly dıed on me. Not cool. I am now try to download the updater from the hotel but I am not sure how to run ıt. any help would be apprecıated. It wıll be awful if ı have not musıc for the remaınder of the trıp. thank you

    You need to download iTunes 7, the iPod updater is now integrated into iTunes so you can always get the latest version using the one application. Each of the older standalone updaters only delivers a single old version of the firmware. Have a look at this page for more detail: iPod 101: Installing and Updating Software

  • How to run recordset SQL query in FORM DATA event

    How can I run recordset SQL query in FORM DATA event upon clicking on Add button in the document?

    Hi Slamet,
    When you receive a form data event you have a class containing inside it a ObjectKeys xml info regarding the object added/modified,...
    With the objects keys you can then use the DI API method called GetByKeys to obtain the DI Object.
    There is some information about it in the SDK Help file, mainly in the "FormDataEvent" class definition:
    <i>The event provides the unique ID (BusinessObjectInfo.ObjectKey) of the modified business object. You can use the value of this property as an input parameter in the DI API DataBrowser.GetByKeys method to get a DI object.</i>
    Pay attention you don't have this information in the Before=True event of the Add as it is not yet in the database.
    Hope it helps
    Trinidad.

  • How to run Windows update for Win XP SP3 using Firefox

    My desktop PC is running windows XP with SP3. My spouse uses IE 8 for her browser. I use Firefox Version 24. for my browser. Previously, whenever we ran MS or Windows update it starts IE and runs fine. IE 8 has blown up and no longer works (Runtime Errors). I tried to go to the Windows update website using Firefox and it came back and told me that I had to use IE to run Win update on an XP system. Is this true? I don't want to use IE at all. Is there a way to use Firefox to run Windows or MS update on my Win XP system? Thank you.

    Thanks for your help. That is not what I wanted to hear so I will have to try to get IE 8 working again. How do other folks do updates? Does this mean that IE is absolutely necessary to maintain your windows system? Is this true for the newer versions of Windows, 7 or 8?

  • How to run a update from APEX 2.1 to APEX 2.2???

    I am using version 2.1, and I want to update to 2.2, I downloaded the file from OTN, but after unziping, I found it is not a simple exe file but a bunch of sql and other files, how to run the upgrading, I think it is too diffficult in that way.
    How many files I need to run in the SQL plus?
    Which one is the one I need?
    Puzzled?

    So there will be no upgrading for Oracle DB XB APEX?The way you ask that implies that I said that this will never be possible and that is not what I said.
    If I want to upgrade to 2.2, I need DBs other than XE?Today you have the option of installing Application Express 2.2 in Oracle Database 9iR2 or the SE, SE1, or EE editions of Oracle 10g Database.
    Scott

  • How to run a BI query from SSM

    HI,
    My client would like to drill down to a BI query where the starting point is a KPI.
    For eg, we have a KPI "Turnover". When we are at kpi detailed level for a specific period, we would like to run a query to have detailed information for turnover (we dont want to use report functionnality of SSM).
    We are using SSM 7.5 and BW queries as data provider.
    Is there a way to achieve this ? (web service ? )
    Thanks in adavnce

    Jacques,
    You cannot run a BI Query from the end user interface of SSM. Your alternatives are to create an associated report inside SSM or use an Associated Link in the KPI Details section.
    Right above the graphing on the KPI detail page there is the link Create Associated Report. SSM has some template reports and allows users to put together a report based on available SSM data.
    There is also the possibility of using Associated Links on the KPI detail page to point the user via a url to another reporting application, though it would not bring that data with it.
    Regards,
    Bob

  • How to run Mass Update with faster speed?

    Hi,
    I am running an update statement of about 300K records and it is very slow. Any advice? Would it be faster if I replace the "in" with an "exists". Thanks.
    Update tablex
    set code ='a'
    WHERE
    id in (select id from tabley)
    and
    code = 'b'

    Would it be faster if I replace the "in" with an "exists".Could be, depending on your unknown database version, if you're on 10g and up, it probably won't matter.
    Here's an explanation:
    http://asktom.oracle.com/pls/asktom/f?p=100:11:7560115908991323::::P11_QUESTION_ID:953229842074

Maybe you are looking for

  • Maintaining Macs--Why doesn't Apple tell you more?

    This is not a problem that I need to solve but just something I've been wondering about. Why doesn't Apple tell people the routines they need to use to maintain their Macs? If you do a search on "maintenance" in Support the fourth item is Mac Mainten

  • Photo order is all messed up with IOS 6. This used to work in IOS 5.

    With IOS 6.0, the order in which photos are displayed on iphone and ipad is all messed up. In iPhoto, you see them sorted by date taken. When you sync this with itunes and view them on ipad/iphone, they show up in the wrong order (sorted by date modi

  • Xbox/express problem gets stuck at 11mbs

    First post I looked all over and couldn't find my answer if its here sorry for this post. I have an Airport Extreme connected to a modem, the modem is in bridge mode. I have the xbox plugged into the lan port on the airport extreme. When I am wired i

  • Preview problem 2014/2

    Since the update to 2014/2 the preview in all Browsers and in Muse Preview itself doesn't work right. I only can see the half of the images. Does anybody else has this problem?

  • ODS to ODS delta load error

    HI Im loading data into a consolidated ODS  from 5 based ODS's. Im doing a delta load from the base to the top level ODS. recently i made change in the cons ODS.I added a key figure to the ODS(not a key field). Now when i try loading delta again, it