Get inserted o updated data

hi
i am using following 
select a.* 
from [dbo].[SampleSourceData] a
left join [dbo].[SampleSourceData1] b
on a.CustomerAcctNum  = b.CustomerAcctNum
WHERE HASHBYTES ('MD5',a.[CustomerAcctNum] + convert(char(10),a.[PaymentDate])+convert(char(10),a.[PaymentAmount]))
<> HASHBYTES ('MD5',b.[CustomerAcctNum] + convert(char(10),b.[PaymentDate])+convert(char(10),b.[PaymentAmount]))
i am inserting this into temp table.now this is giving me when any update is made and it doesnt exist in anothe table.
but also i want if any new row inserted , it should catch in above statement.
how to do it

Please follow basic Netiquette and post the DDL we need to answer this. Follow industry and ANSI/ISO standards in your datA. You should follow ISO-11179 rules for naming data elements. You should follow ISO-8601 rules for displaying temporal datA. We need
to know the data types, keys and constraints on the table. Avoid dialect in favor of ANSI/ISO Standard SQL. 
OUTER JOINs are rare in a properly designed schemA. Sure wish we had DDL. Do you know why noobs use alphabetic aliases? ANSWER: To mimic the names of mag tape drives on 1970's computers! Do you know to why noobs put a sequence number after a table name? ANSWER:
To mimic the names of mag tape file sets on 1970's computers! They have built a repeating group of tables in violation of First Normal Form.
We use CAST() and not the old Sybase CONVERT() string function; which you use without a datetime  format parameter. 
If you want to know what is updates, we have lots of logging tools that are cheap, fast and will not get you in jail. 
>> I am inserting this into temp table. <<
Just the way we wrote to a scratch tape in the 1970's!  You are still a COBOL programmer and do not understand SQL and declarative programming yet. 
--CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
in Sets / Trees and Hierarchies in SQL

Similar Messages

  • Insert or Update data in SAP with Business Objects?

    Hi all,
    I am new to Business Objects world with my little expertise in Crystal Reports and Xclesius.
    Could you please clarify me that is there any solution or technology or Product of Business Objects which not only make impressive dashboards and analyze the data but also can communicate with back end SAP R/3 to save or update data.
    We are actually analyzing our Client requirements in which there is a need of Dashboards as well as some custom configurations that needs to be saved somewhere in the SAP system in order to make decisions in future.
    Our back end system is SAP BW. One possibility is to use Adobe Flex as a base architecture with BSP and BW but we are more concerned with what BOBJ provides.
    Looking forward for your suggestions.
    Kind Regards
    Umer Farooq

    GR81 wrote:
    I would like to know how I can insert or update data in a Google Spreadsheet from an Oracle Database please?
    Thanks,you can't since Oracle knows nothing about spreadsheets; Google or otherwise.

  • Connecting to datasource and retrieve, insert and update data in SQL Server

    hi,
    i am trying to retrieve, insert and update data from SQL Server 2000 and display in JSPDynPage and is for Portal Application. I have already created datasource in visual composer. Is there any sample codes for mi to use it as reference???
    Thanks
    Regards,
    shixuan

    Hi,
    See this link
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/6209b52e-0401-0010-6a9f-d40ec3a09424
    Regards,
    Senthil kumar K.

  • Connecting to datasource and retrieve, insert and update data

    hi,
    i am doing a JSP page that need to retrieve data and display on textView, insert data and update data. I have already create a datasource in Visual Composer. Does anyone have a sample codes for mi to use it as reference. So that i can connect to the datasource tat i created in Visual composer and retrieve, insert and update data. thanz
    Regards,
    shixuan

    Hi,
    After creating a data source in Visual composer .
    you have to create a BI system that Visual Composer can use in
    the SAP NetWeaver Portal.
    refer this pdf file for further Info
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/6209b52e-0401-0010-6a9f-d40ec3a09424
    Regards,
    Beevin

  • Report doest get refreshed with updated data

    Hi All,
    I am facing a strange problem, where my report doest get refreshed with updated data when it’s called second time.
    1.     Screen1 – Preview option – Preview Screen
    2.     Preview Screen – Print option (Button) – Report generated and displayed in the IE Browser window with a dynamically generated PIN (Query written in WHEN-BUTTON-PRESSED trigger)
    3.     Screen2 is displayed in the backend
    4.     Screen2 – Cancel option – Screen1
    5.     Screen1 – Preview option – Preview Screen
    6.     Preview Screen – Print option (Button) – Report generated and displayed in the IE Browser window with a same PIN as in step2. Actually here the Query written in WHEN-BUTTON-PRESSED trigger generates a new PIN.
    7.     When checked in the backend this new PIN is updated, but the same is not displayed on the Report. That means to say that report is not refreshed. When I click on the refresh button in the IE Browser window explicitly, the report is refreshed and displays the PIN as found in the backend.
    What I expect is that the report should get refreshed automatically with a new PIN, when I choose Print option in Preview Screen.
    Can anybody help me in overcoming this challenge?
    Regards,
    SAM

    Hi All,
    What i did was i encoded the PIN and sent it as a paramter to call the report.
    In the report i decoded the PIN and printed it. This way my URL to call the report was always updated with the decoded PIN value and would refresh the page successfully, everytime its called.
    Regards,
    SAM

  • How to get the last update date

    Hi Everyone,
    I need to insert into a table the name of the package and date of the last updated version of the execution.
    I was thinking in inserting from procedure into a table, the ID and system date into a table.
    But I would like to know if there is another way, or better way of doing this.
    I do appreciate your help and guidance.
    Best regards.
    J_ORCL
    Edited by: J_ORCL on Apr 23, 2012 9:16 AM

    Hey Atdi,
    Thank you so much for your guidance and help.
    What i do need is the following:
    Once I am inserting/passing some data into a table from an excel file/Database to an Oracle Table in my environment, I do need now to get a record of the last update that has been inserted. And after that I will have to show that date on my screen, but that is something else.
    So i have thought of inserting it with a store procedure over a new table that i will have to create or if ODI stores this information somewhere it will be really useful for me to retrieve from there.
    In some cases I am passing data from one table to other using store procedures, because there is no link between them, but as this is a new scenario, which is why I am asking if ODI already does this for us, or if I will have to implement it myself.
    Hope to be a bit clearer with this explanation.
    Please do not hesitate to contact me if any further detail is required.
    Best regards.
    J_ORCL

  • How to get new and updated data into LO Excel in Xcelsius

    Dear Experts,
    I have created dashboard on top of webi report by using Live-Office connection. Latest data of webi report is imported into excel and mapped data with components and generated SWF file and exported into server.
    To day my webi report has latest instance with new and updated data. But until unless by clicking "Refresh All Objects" i am not getting updated data into excel.
    When i am trying to open dashboard in BI Launch Pad/CMC it is showing data whatever exist in excel(i.e yesterday data). But here we need to show data of latest instance of webi report.(i.e New and updated data as of now).
    I have selected option "Latest instance: From latest instance scheduled by" in "refresh options".
    My Question & Doubts:
    1) Is it mandatory to open dashboard every day and need to click on "Refresh All Objects" to get updated data into excel or dashboard.
    2) Is there any option to automate this process.
    Regards,
    PRK.

    Hi,
    Schedule the webi report to get the latest data from the source. To answer your query no is doesn't require to open the dashboard every time to refresh the excel to get the latest data.
    Please use the Refresh Before Components are Loaded: Select this option to refresh the data each time the model loads and to use that data as the initial data for the model (using a Reset Button component, it will reset the data to the values from the last time the model was loaded).
    You are using the Live Office  so here automatic refresh is not possible without touch the swf file, you need to use the refresh but to get the latest data. If you are using QAAWS, Web Service & XML then automatic refresh is possible.
    For more information please check the below document for in-depth idea on the design pattern.
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/b02e31fb-3568-2e10-e78f-92412c3c0a96?overridelayout=t…
    Kindly revert for more clarification!!!
    --SumanT

  • How to insert last update date and user id to a form?

    Hi,
    I have created a form to enter data to a custom table.
    When a new record is created, I would like to keep track of the creation date, last update date and who (user id) enters the form.
    Can someone please help or point me to a right place to look for this information?
    Thank you!
    LC

    Create four new columns in your table called Created_On, Created_By, Last_Updated_On and Last_Updated_By.
    You can create a trigger to accomplish the rest:
    create or replace trigger "<name of your trigger>"
      before insert or update on "<name of your table>"
      for each row
    begin
      if inserting then
        :NEW.Created_On := sysdate;
        :NEW.Created_By := v('APP_USER');
      end if;
      if updating then
        :NEW.Last_Updated_On := sysdate;
        :NEW.Last_Updated_By := v('APP_USER');
      end if;
    end;Every time you'll add or modify data in that table, the trigger will automatically fill those fields.
    Regards,
    Mathieu

  • Issue while insert and update data to DB tables

    Hello all,
    i am having an issue while insert the data to DB table.
    my scenario is DB1 to DB2. i had a sender channel with select query which fetches data from DB1 and inserts to DB2.
    so the select query will fetch the records that were INSERTED to DB1 and records that were UPDATED to DB1 and needs to insert/update to DB2 table.
    Now the issue is i am able to insert the records but not able toupdate the records to DB2 table due to primary key issue.
    im message mapping
    sender message type is as follows:
    <src_message1>
    ----<row>
    -------<fieldA>
    -------<filedB>
    -------<filedC>
    Receiver message type as follows:
    <trgt_message1>
    ----<STATEMENT_1>
    ----<TABLE_NAME>
    ----<ACTION> INSERT
    ----<TABLE>
    ----<ACCESS>
    ----<field1> primary key
    ----<field2>
    ----<field3>
    ----<field4>
    ----<KEY>
    ----<field1>
    ----<field2>
    ----<field3>
    ----<field4>
    my query in sender channel is : select filedA, filedB, filedC from test_table where createdate=sysdate or updatedate=sysdate
    so it feteches the data from DB1 and inserting to DB2 but not updating the records to DB2 due to primarykey issue.
    please suggest how to solve ....will it solve by using UPDATE_INSERT for action?
    Best Regards,SARAN

    Hi Nagarjuna,
    i have done the following changes to target mapping structure;
    1. action as UPDATE_INSERT
    2.  in access tab, i had mapped fieldDate to field4.
    3. in Key tab, i assigned the sysdate to field4.
    but issue still exist. could you please check my above changes are correct or not. if wrong please provide me the details that needs to be done.
    thanks in advance.
    i'm providing the error details again:
    my query in sender channel is : select filedA, filedB, filedC, FiledDate from TEST_TABLE where fieldDate=sysdate or updatedate=sysdate
    it returns 4 records as follows:
    fieldA--fieldB-fieldC---fieldDate
    1001----EU----  1----
        2011-11-10
    1002----CN----  0----
         2011-11-10
    1003----AP---- 1----
          2008-03-15 (already exist in DB2)
    1004----JP----  1----
        2007-04-12 (already exist in DB2)
    the first two records are created today and remaining 2 records are updated the fieldC from 0 to 1 ( in DB1 )
    while inserting these 4 records to DB2, we get the following error "java.sql.SQLException: ORA-00001: unique constraint (data.TEST_TABLE_PK) violated" .
    Best Regards,SARAN

  • Getting error while updating data element using Xquery Automator

    Hi,
    I am getting following error while i am trying to update a data element in my task.
    <Nov 28, 2011 5:02:40 PM IST> <Error> <oms> <BEA-000000> <automation.AutomationDispatcher: Failed to execute
    on/plugin/external/ACOI_TMIP_POC/1.0.0/CLARIFY_Task.automatedtask.acoi_tmip_poc.ResponseAutomation] due to E
    hile running Script resource [file:///D:/AshishWorkspace_WithOrchestration/ACOI_TMIP_POC/resources/CLARIFY_R
    exception location: ; SystemID: module with no systemId*; Line#: 15; Column#: -1*
    com.mslv.oms.automation.AutomationException: Exception thrown while running Script resource [file:///D:/Ashi
    rchestration/ACOI_TMIP_POC/resources/CLARIFY_Response.xquery]; exception location: ; SystemID: *module with
    e#: 15; Column#: -1
    the Xquery that i am using is pretty simple:
    declare namespace automator = "java:oracle.communications.ordermanagement.automation.plugin.ScriptSenderContextInvocation";
    declare namespace context = "java:com.mslv.oms.automation.TaskContext";
    declare namespace log = "java:org.apache.commons.logging.Log";
    declare namespace oms="urn:com:metasolv:oms:xmlapi:1";
    declare namespace prop = "OSM_POC";
    declare variable $xmlnsosm7POC := "";
    declare variable $log external;
    declare variable $automator external;
    declare variable $context external;
    let $CLFY_XML := //CLFY_XML
    let $Id_Number :=//Id_Number
    return
    automator:setUpdateOrder($automator,"true"),
    log:info($log,fn:concat('ID request number is: ', $Id_Number)),
    <ord:OrderDataUpdate xmlns="http://www.w3.org/2001/XMLSchema" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:odu="http://www.oracle.com/OMS/OrderDataUpdate" targetNameSpace="http://www.oracle.com/OMS/OrderDataUpdate" xmlns:ord="urn:com:metasolv:oms:xmlapi:1">
    <ord:Add path="/CLFY_ID">{data($Id_Number)}</ord:Add>
    </ord:OrderDataUpdate>
    Can anyone please tell me the reason due to which this error is coming.
    Thanking in advance
    Ashish Garg

    Hello.
    Ok I need you to tell me a little bit more about your automator, did you config an Xquery Automator with Event Type: Internal?
    You should declare namespace automator = "java:oracle.communications.ordermanagement.automation.plugin.ScriptReceiverContextInvocation";
    instead of
    declare namespace automator = "java:oracle.communications.ordermanagement.automation.plugin.ScriptSenderContextInvocation";
    And let my ask you, what are you trying to do with the next lines:
    let $CLFY_XML := //CLFY_XML
    let $Id_Number :=//Id_Number
    Becouse I think you are trying to acces the data on the task, If that is the reason, you should better use something like:
    let $order := ..//oms:GetOrder.Response
    let $orderId := $order/oms:_root/oms:orderHeader/oms:orderId
    with the above lines you are accesing the data that has been added to the task and the just acces the node that you nedd, for example here Im accesig the node
    orderId under OrderHeader
    Another thing is that if you want to update node which already exists in the task data, then you have to use something like:
    <OrderDataUpdate xmlns="http://www.metasolv.com/OMS/OrderDataUpdate/2002/10/25">
    <Update path="/orderHeader/orderId">{$orderId}</Update>
    </OrderDataUpdate>
    But if you have to add a new path you should have something like this:
    <OrderDataUpdate xmlns="http://www.metasolv.com/OMS/OrderDataUpdate/2002/10/25">
         <Add path="/OrderHeader">
              <Transaction>
                   <Name>{$orderId/text())}</Name>
              <ComponentKey>{$controlData/text()}</ComponentKey>
              </Transaction>
         </Add>
    </OrderDataUpdate>
    For the above transaction you should have in the dictionary the structure, OrderHeader in the root, and inside this the structure another node with the respective names
    <Transaction>
                   <Name>{$orderId/text())}</Name>
              <ComponentKey>{$controlData/text()}</ComponentKey>
              </Transaction>
    Another thing is that you should have all this structures in the Task Data of this Task.
    Hope this help
    Lucas.

  • Why do I get iMessage failed update date and time in settings

    My iphone5 keeps changing it time zone on it's own and I keep getting a notification in messages saying iMessage failed update your date and time in settings.  I have update it several times and it's keep doing it.  Now it's just frustrating.  How can I take care of this problem for good. 

    I have also been getting the message ever since I got my iPhone 5 on September 12.  I have to reboot the phone to fix the problem or turn the "Set Automatically" off and then back on. This is a glitch likely with Apple's iOS software, but my Verizon store said that have received numerous complaints on this issue, but no patch has been released for it as of yet.

  • To find last inserted or updated date from an schema

    Hi,
    i need a query to find the list of tables which was last updated or inserted (upto 2003) from a schema..
    Rgds.

    Such information is nowhere stored , the only 'date' column in DBA_TABLES is 'LAST_ANALYZED'.
    Werner

  • Insert or Update data from PROD dc to DEV DB

    We have one instance of a DB in PROD box and another in DEV box [unix]
    Requirement is to write a script to copy data from PROD to DEV for 10 related tables.
    Store Procedure will have input argument as Number or FromDt and To Date [date range]
    Can anyone give step by step guide to do this? Have worked on Package proc and store proc for Oracle 8 but for long have no touch or Oracle. We have Oracle 10g at present.
    TIA.

    "@PROD" uses a database link (called PROD) to access the remote table. In the definition of the database link are all the sql*net parameters necessary for one database to connect to another.
    You can start by reading the SQL Reference Manual to get the basics of the CREATE DATABASE LINK statement. It has links to other manuals as well:
    http://download-east.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_5005.htm#i2061505

  • Inserting and updating date & time in oracle 8i

    I am using JDBC thin driver. I am not able to insert date and time in American format.

    The best way for you is to use the TO_DATE function. It will allow you to specify the date format.

  • FRM-40602: Cannot insert into or update data in a view

    Hi all!
    I have a form based on a view and I want to get rid off this message.
    I set the properties blocks query only but it still doesn't work.
    Does someone met with this situation?
    Many thanks!

    Hello
    I've just been messing about with a similar problem. Basically, I have a view that involves a join across two tables, I have a data block in my form that's based on the view, and I've written an INSTEAD OF trigger to insert/update/delete from the two tables.
    I was getting the error message 'Cannot insert or update data in a view', and it turned out that the error was happening because the join column between the two tables was the primary key on one of the tables, but the corresponding column on the join table had no unique key on it. This meant that Oracle couldn't establish a one-to-one relationship between rows in the view and rows in the underlying tables. The column on the join table was in fact unique on that table, and adding a unique constraint on that column in the database cured the problem.
    Hope that's of use.
    regards
    Andrew
    UK

Maybe you are looking for

  • Fact Tables

    Hi! I needed help on understanding how data is tored in the FACT Tables. I am currently facing an issue after running SPRUNCONVERSION. The stored procedure generates 4 records in the FACT tables and thereby eliminates any converted values. For eg, If

  • Safari barely works. VERY SLOW.

    Three days ago, March 27, evening, Pacific Daylight Time, I tried to download something from iTunes from my Mac.  I had always used my iPad before.  It downloaded it, then when I went to play it, it said the Mac was not authorized and window came up

  • HT5105 How can you do picture in picture when you are working with a Multicam clip?

    How can you do picture in picture when you are working with a Multicam clip?

  • Standard Date Fn

    Hi All, Are there any standard Date functions to calculate like 90 days, 60 days & 30 days of present day? And also to find the previous month of the present month & Month in Character format. If it is there please let me know. Thanks & Regards Rajen

  • Pictures are missing

    I have recently noticed that all my pictures disappeared from my phone.  When I take new pictures I select save but when I want to view the pics afterwards they are not there. When I go to WhatsApp and select to send a picture from this application,