Save only edited or new records

Hi,
I have a block based on a table and display a few records on the form after retrieving records from the table behind. Now I should be able to edit a record or add a new record to the existing records on the screen. So when i click the save button I only want the rows which are new or have been edited to go back into the db. This is the piece of code I was using for the save button in the on-button-clicked action.
IF alert_button=alert_button1 THEN
GO_BLOCK('my_block');
IF NOT Form_Success THEN RAISE Form_Trigger_Failure;
END IF;
/* ** Commit if anything is changed */
IF :System.record_Status IN ('CHANGED','NEW') THEN Commit_Form;
END IF;
msg_info('Your changes have been saved.');
END IF;
When I do this all the records on the screen gets inserted into the table instead of only the one's I have edited or newly inserted. I only want to insert rows which are new or edited into the table after I click the save button.

If the only reason for your procedure is to filter the records, Forms handles this natively when you place the Form in "Enter Query" mode (Forms 6i = F7, Forms 9i or higher = F11). A user can enter their search criteria in each field displayed (to include Oracle Wildcard charaters) and then execute the query using F8 (Forms 6i) or Ctrl+F11 (Forms 9i or higher). This is one of the great features of Forms is that it doesn't require additionaly programming to accomodate searches. Once has queried the records into the data block, Forms keeps track of which records were modified or are new. When you Save (Commit_Form), Forms will update or insert as needed to save the changes the user made.
As Inol suggested, if you need to gather search criteria fro m your us er a different way, you can use the criteria to change the W here Clause of the data block to display records. In this situation, you would code your "Search" button to modify the w here clause. Here's an example w here a user can search on an employee's first name, last name, employee id or any combination of the three:
First Name [                  ]    Last Name [                      ] Emp ID [                     ]
[SEARCH]
/* Sample When-Button-Pressed trigger for Search button */
/* Example of searching by Last Name */
DECLARE
   v_def_where    VARCHAR2(500);
BEGIN
   IF ( :search_block.first_name IS NOT NULL ) THEN
      v_def_where := 'first_name = :search_block.first_name';
   END IF;  
   IF ( :search_block.last_name IS NOT NULL ) THEN
      IF (v_def_where IS NOT NULL ) THEN
         v_def_where := v_def_where || ' and ';
      END IF;
      v_def_w here := v_def_w here || ' last_name = :search_block.last_name';
   END IF;
   IF ( :search_block.employee_id IS NOT NULL ) THEN
      IF (v_def_where IS NOT NULL ) THEN
         v_def_w here := v_def_w here || ' and ';
      END IF;
      v_def_w here := v_def_w here || ' last_name = :search_block.employee_id';
   END IF;
  IF ( v_def_w here IS NOT NULL ) THEN
      /* Forms 6i */
      S et_B lock_Property('DATA_BLOCK',DEFAULT_W HERE, v_def_w here);
      /* Forms 9i or Higher */
      S et_B lock_Property('DATA_BLOCK',ONETIME_W HERE, v_def_w here);
      Execute_Query;
   ELSE
      Message ('No Search Criteria was entered.');
      Message ('No Search Criteria was entered.');
      RAISE Form_Trigger_Failure;
   END IF;
END;NOTE: As you can see I had to EDIT this post numerous times to get it to save. X-( There are spaces embedded in the code sample.
Hope this helps,
Craig B-)
If a response is helpful or correct, please mark it accordingly.
Edited by: CraigB on May 17, 2010 12:21 PM
Edited by: CraigB on May 17, 2010 12:22 PM
Edited by: CraigB on May 17, 2010 12:23 PM
Edited by: CraigB on May 17, 2010 12:24 PM
Edited by: CraigB on May 17, 2010 12:24 PM
Edited by: CraigB on May 17, 2010 12:24 PM
Edited by: CraigB on May 17, 2010 12:26 PM
Edited by: CraigB on May 17, 2010 12:28 PM
Edited by: CraigB on May 17, 2010 12:29 PM
Edited by: CraigB on May 17, 2010 12:31 PM
Edited by: CraigB on May 17, 2010 12:33 PM
Edited by: CraigB on May 17, 2010 12:34 PM
Edited by: CraigB on May 17, 2010 12:36 PM
Edited by: CraigB on May 17, 2010 12:37 PM
Edited by: CraigB on May 17, 2010 12:37 PM

Similar Messages

  • Issue editing a new record in simple ADF form

    I have a simple ADF entry form and table that saves to a database table. The database table has columns that cannot have null values.
    I can create, edit, delete and save rows in the ADF form without problems.
    The problem I have is when I edit a row that I just created and saved. I get an error message that says I cannot save null into the fields that cannot have null values in the database, even though my form shows that my newly created and saved is data there. I seem to have to edit those fields to get the model entity to recognize that there is some value in them.
    So the sequence of events leading to the error is this:
    I create a new record with ADF form using the 'Create' or 'CreateInsert' operation command button, I enter data into all the fields and hit commit.
    I decide I want to make a change to one of the fields, I enter some text, click commit again and an error message pops up saying that I cannot enter null into a required field, but there is data in the field and I did not change anything in it.
    The only way I can save without error now is either by running a rollback operation now or making a edit to all the required fields to get the linked entity to not send a null value to the database.
    This error will still occur even if I navigate away from the newly created record to other records, if I ever navigate back to that record created in the current session, I will get that error message.
    Anyone else experience a similar problem?
    Are there any settings or properties I need to set in the entity that can avoid sending null values to the database when a value already exists?
    I thought at first it was because I'm using the 'CreateInsert' operation to create a new record as opposed to the 'Create' operation, but the same problem exists with both operations.

    I am using jDev version 11.1.2.1.0
    In you sample, does your database have columns that require a not null value?
    I think my problem lies in the entity or view somewhere, how it's sending null value for fields that don't need to be updated.
    Here's the source for my entity and view.
    Entity:
    <?xml version="1.0" encoding="windows-1252" ?>
    <!DOCTYPE Entity SYSTEM "jbo_03_01.dtd">
    <!---->
    <Entity
    xmlns="http://xmlns.oracle.com/bc4j"
    Name="Feedback"
    Version="11.1.2.60.81"
    DBObjectType="table"
    DBObjectName="FEEDBACK"
    AliasName="Feedback"
    BindingStyle="OracleName"
    UseGlueCode="false">
    <Attribute
    Name="FeedbackId"
    Precision="10"
    Scale="0"
    ColumnName="FEEDBACK_ID"
    SQLType="NUMERIC"
    Type="oracle.jbo.domain.Number"
    ColumnType="NUMBER"
    TableName="FEEDBACK"
    PrimaryKey="true">
    <DesignTime>
    <Attr Name="_DisplaySize" Value="22"/>
    </DesignTime>
    </Attribute>
    <Attribute
    Name="PageName"
    IsNotNull="true"
    Precision="200"
    ColumnName="PAGE_NAME"
    SQLType="VARCHAR"
    Type="java.lang.String"
    ColumnType="VARCHAR2"
    TableName="FEEDBACK"
    IsUpdateable="while_insert"
    RetrievedOnInsert="true"
    RetrievedOnUpdate="true">
    <DesignTime>
    <Attr Name="_DisplaySize" Value="200"/>
    </DesignTime>
    </Attribute>
    <Attribute
    Name="Severity"
    Precision="30"
    ColumnName="SEVERITY"
    SQLType="VARCHAR"
    Type="java.lang.String"
    ColumnType="VARCHAR2"
    TableName="FEEDBACK"
    IsNotNull="true">
    <DesignTime>
    <Attr Name="_DisplaySize" Value="30"/>
    </DesignTime>
    </Attribute>
    <Attribute
    Name="InternalAction"
    Precision="30"
    ColumnName="INTERNAL_ACTION"
    SQLType="VARCHAR"
    Type="java.lang.String"
    ColumnType="VARCHAR2"
    TableName="FEEDBACK">
    <DesignTime>
    <Attr Name="_DisplaySize" Value="30"/>
    </DesignTime>
    </Attribute>
    <Attribute
    Name="FeedbackNote"
    IsNotNull="true"
    Precision="4000"
    ColumnName="FEEDBACK_NOTE"
    SQLType="VARCHAR"
    Type="java.lang.String"
    ColumnType="VARCHAR2"
    TableName="FEEDBACK">
    <DesignTime>
    <Attr Name="_DisplaySize" Value="4000"/>
    </DesignTime>
    </Attribute>
    <Attribute
    Name="InternalNote"
    Precision="4000"
    ColumnName="INTERNAL_NOTE"
    SQLType="VARCHAR"
    Type="java.lang.String"
    ColumnType="VARCHAR2"
    TableName="FEEDBACK">
    <DesignTime>
    <Attr Name="_DisplaySize" Value="4000"/>
    </DesignTime>
    </Attribute>
    <Attribute
    Name="CreatedBy"
    Precision="30"
    ColumnName="CREATED_BY"
    SQLType="VARCHAR"
    Type="java.lang.String"
    ColumnType="VARCHAR2"
    TableName="FEEDBACK">
    <DesignTime>
    <Attr Name="_DisplaySize" Value="30"/>
    </DesignTime>
    </Attribute>
    <Attribute
    Name="CreationDate"
    ColumnName="CREATION_DATE"
    SQLType="TIMESTAMP"
    Type="oracle.jbo.domain.Date"
    ColumnType="DATE"
    TableName="FEEDBACK">
    <DesignTime>
    <Attr Name="_DisplaySize" Value="7"/>
    </DesignTime>
    </Attribute>
    <Attribute
    Name="ActionDate"
    ColumnName="ACTION_DATE"
    SQLType="DATE"
    Type="oracle.jbo.domain.Date"
    ColumnType="DATE"
    TableName="FEEDBACK"/>
    <Attribute
    Name="ReviewedBy"
    Precision="30"
    ColumnName="REVIEWED_BY"
    SQLType="VARCHAR"
    Type="java.lang.String"
    ColumnType="VARCHAR2"
    TableName="FEEDBACK">
    <DesignTime>
    <Attr Name="_DisplaySize" Value="30"/>
    </DesignTime>
    </Attribute>
    <Attribute
    Name="AssignedTo"
    Precision="30"
    ColumnName="ASSIGNED_TO"
    SQLType="VARCHAR"
    Type="java.lang.String"
    ColumnType="VARCHAR2"
    TableName="FEEDBACK">
    <DesignTime>
    <Attr Name="_DisplaySize" Value="30"/>
    </DesignTime>
    </Attribute>
    <Key
    Name="Xpkfeedback"
    PrimaryKey="true">
    <DesignTime>
    <Attr Name="_DBObjectName" Value="XPKFEEDBACK"/>
    </DesignTime>
    <AttrArray Name="Attributes">
    <Item Value="ichip.util.Feedback.FeedbackId"/>
    </AttrArray>
    </Key>
    </Entity>
    View:
    <?xml version="1.0" encoding="windows-1252" ?>
    <!DOCTYPE ViewObject SYSTEM "jbo_03_01.dtd">
    <!---->
    <ViewObject
    xmlns="http://xmlns.oracle.com/bc4j"
    Name="FeedbackView"
    Version="11.1.2.60.81"
    SelectList="Feedback.FEEDBACK_ID,
    Feedback.PAGE_NAME,
    Feedback.SEVERITY,
    Feedback.INTERNAL_ACTION,
    Feedback.FEEDBACK_NOTE,
    Feedback.INTERNAL_NOTE,
    Feedback.REVIEWED_BY,
    Feedback.CREATED_BY,
    Feedback.CREATION_DATE,
    Feedback.ACTION_DATE,
    Feedback.ASSIGNED_TO"
    FromList="FEEDBACK Feedback"
    BindingStyle="OracleName"
    CustomQuery="false"
    PageIterMode="Full"
    UseGlueCode="false"
    OrderBy="Feedback.PAGE_NAME asc,Feedback.FEEDBACK_ID desc">
    <EntityUsage
    Name="Feedback"
    Entity="ichip.util.Feedback"/>
    <ViewAttribute
    Name="FeedbackId"
    IsNotNull="true"
    PrecisionRule="true"
    EntityAttrName="FeedbackId"
    EntityUsage="Feedback"
    AliasName="FEEDBACK_ID"/>
    <ViewAttribute
    Name="PageName"
    IsNotNull="true"
    PrecisionRule="true"
    EntityAttrName="PageName"
    EntityUsage="Feedback"
    AliasName="PAGE_NAME"
    DefaultValue="Feedback"/>
    <ViewAttribute
    Name="Severity"
    IsNotNull="true"
    PrecisionRule="true"
    EntityAttrName="Severity"
    EntityUsage="Feedback"
    AliasName="SEVERITY"/>
    <ViewAttribute
    Name="InternalAction"
    PrecisionRule="true"
    EntityAttrName="InternalAction"
    EntityUsage="Feedback"
    AliasName="INTERNAL_ACTION"/>
    <ViewAttribute
    Name="FeedbackNote"
    IsNotNull="true"
    PrecisionRule="true"
    EntityAttrName="FeedbackNote"
    EntityUsage="Feedback"
    AliasName="FEEDBACK_NOTE"/>
    <ViewAttribute
    Name="InternalNote"
    PrecisionRule="true"
    EntityAttrName="InternalNote"
    EntityUsage="Feedback"
    AliasName="INTERNAL_NOTE"/>
    <ViewAttribute
    Name="ReviewedBy"
    PrecisionRule="true"
    EntityAttrName="ReviewedBy"
    EntityUsage="Feedback"
    AliasName="REVIEWED_BY"/>
    <ViewAttribute
    Name="CreatedBy"
    IsNotNull="true"
    PrecisionRule="true"
    EntityAttrName="CreatedBy"
    EntityUsage="Feedback"
    AliasName="CREATED_BY"/>
    <ViewAttribute
    Name="CreationDate"
    IsNotNull="true"
    PrecisionRule="true"
    EntityAttrName="CreationDate"
    EntityUsage="Feedback"
    AliasName="CREATION_DATE"/>
    <ViewAttribute
    Name="ActionDate"
    PrecisionRule="true"
    EntityAttrName="ActionDate"
    EntityUsage="Feedback"
    AliasName="ACTION_DATE"/>
    <ViewAttribute
    Name="AssignedTo"
    PrecisionRule="true"
    EntityAttrName="AssignedTo"
    EntityUsage="Feedback"
    AliasName="ASSIGNED_TO"/>
    </ViewObject>

  • How to call a form so as it starts edit  mode (new record) directly

    Hi,
    I want to call a form from a button so as it starts edit mode directly (for a new record).
    I also want to pass it parameters for the new record
    please help me
    thanks

    Suppose you want to call the form with the ename as CLARK. You can call the form like this:
    <portal_schema>.wwa_app_module.link?p_arg_names=_moduleid&p_arg_values=<module_id of the form>&p_arg_names=ename&p_arg_values=CLARK
    Note that it will not query the database for values unless you pass the argument enamecond as well.
    Regards,
    Hsiu

  • SSIS DataFlow - copy only changed and new records

    I am copying a few tables each night from one SQL server to another. At the moment I delete every record from the destination table, and then copy all records from the source table with a SSIS Data Flow Task. 
    That works fine so far, but I would like to copy only changed or new rows. What would be the best way with SSIS to achieve this? I am quite new to SSIS, I have no idea if my goal is possible and how...

    I am copying a few tables each night from one SQL server to another. At the moment I delete every record from the destination table, and then copy all records from the source table with a SSIS Data Flow Task. 
    That works fine so far, but I would like to copy only changed or new rows. What would be the best way with SSIS to achieve this? I am quite new to SSIS, I have no idea if my goal is possible and how...
    Many ways:
    1st way
    1.use Merge function from source to destination table where you can have this conditions like load when not matched and don't load when matched.
    2. follow this ssis steps:
    execute sql task where you can write merge function from source to destination 
    http://blog.sqlauthority.com/2008/08/28/sql-server-2008-introduction-to-merge-statement-one-statement-for-insert-update-delete/
    2nd way:
    oledb source 2.lookup outputlookup 3. oledb destination table 
    and you can mention in lookup as no match output.
    3rd way:
    you can use scd transformation task in ssis...
    4th way:
    you can use if exists update  if not exists insert.. see below
     http://blogs.msdn.com/b/miah/archive/2008/02/17/sql-if-exists-update-else-insert.aspx
    http://sequelserver.blogspot.com/2011/02/alternate-to-if-exists-update-else.html
    - please mark correct answers

  • Save VO with Edited fields But as a New Record, Old one should not change

    Hi All,
    I have set of VOs, those are connected by View links, in such a way One VO comes under Another up to 7 level,
    Like
    level----1
    2
    3
    4
    5....
    And My requirement is if I made any of the Operations,( Insert/update/Delete) on any of the VO's(Records of the VO) that comes in this flow, I have to save it as a new record with the Edited Fields , new Id and new revision number, Also I have to keep the original one unchanged.
    that is After updating the record I should have the old one as a Library and New one as the active record.
    Please help....

    Hi Timo,
    The JDev I am using is Studio Edition Version 11.1.1.2.0 and Build JDEVADF_11.1.1.2.0_GENERIC_091029.2229.5536
    And the Relationships between the VO's are *:* When I change a record of level 3, I need to copy all the other 6 levels along with the updated one.
    The revision Number is in the Top VO, which will increment but all the other record will remains the same other than Id and updated fields.
    That is , there should be a new set of records with the same data with updated fields, and the old set remain the same, which can be used as a Library for reference.
    Thanks & Regards,
    Ranjith C

  • How to populate new record on data entry form based on search results?

    Hello,
    I'm new to jdeveloper im using version 11.1.2.1.0.
    Usually Im using forms 10g.
    I created search panel with table and its working but problem is how to transfer/populate all the field value according to that search result to New data Entry Form
    by clicking the table record or a button.
    Given :
    TABLES,EO
    1. PatientMasterIndex
    2. PatientTransactionMaster <<---- master
    3. PatientTransactionDetail <<-- detail relation
    Here the scenario,
    After Search of any patient, when i clicked one or more patient (which Jdeveloper allow multi select on jtable) on the table record it should automatically transfer or copied to the text field, i want to show on the form of PatientTransactionMaster like PatientNumber,PatientInsuranceNumber etc. to be save on db as new record, also non database field for view only like patient Name,address,age.
    IN forms i can do that by :PatientTransactionMaster.PatientNumber := :blocksearch.PatientSearchNumber ,etc.....
    or an item trigger to populate the said PatientTransactionMaster block. ( select .... into :PatientTransactionMaster.PatientNumber,etc....)
    Any suggestion,links,sample is highly appreciated.
    Sorry for my english.
    Thank you very much

    Hi,
    Do you want to create a detail record that will include some values from your master record??
    Or do you want to create a record with values from your Search criteria, only in the case you do not have any results?
    if it is the second case.
    When do you want to do that? After a press of button? or immediately?
    In general you have to handle the values from search criteria.
    Additionally, if you use ViewCriteria, you have to have bind variables for your search criteria that you will want to use.
    So in general, you have to know the values by using bind variables, understand that the query has no results (This can be done in many ways, depending on your implementation. if you are using a button, you could make a disable condition with iterator.estimatedRowCount property.)
    Perform the insert operation with the values from the bind variables.
    Regards,
    Dimitris.

  • Generate extra record when create a new record in secondary form

    I have been troubshooting this for a logn time:
    I have exemption form ties to exemption table. because there are two many info on exemption form, I create a second form called exemption (2) form and ties to exemption(2) table. Then, I create a "Go to exemption(2) form" button from the first form and it will redirect the user to the second form once they click it.
    Once the users complete the second form entry, and click the Create(which is the save record) button, it not only creates a new record in exemption (2) table but also create an extral record in the first exemption table.
    I used the exemption sequence to genertate the id so for example,
    Exemption (1) has 3 records so far, but after the user add the record in the second form, Exemption (1) has 4 records.
    How do I make the first form and the second form consistent in the ID?
    Thanks so much in advance!

    Thank you Tauceef for your help,
    If I get your problem exactly, you are using a sequence for the ID, and you want to insert the same ID in both Tables 1 & 2 - Yes, it is exactly what I want to do
    for that what you can do is, in the first form submit process, you can assign the sequence value to a hidden or application - I use exemption sequence and the first form takes nextval of it.
    item in your first form and use that item in your second form. - then, I went to the second form, and assign the ID to the first form ID (the page item in application)
    I got error message saying can not insert NULL value to second table, can not process the row.
    Can you show me the submit process in the first form?
    Hope it won't take too much of your time,
    Kitty,

  • In IPhoto or IPad, when I edit a photo in an existing album, the photo is removed and placed in a new album with only edited photos. How do I keep it in or get it back to its original album?

    When using IPhoto for IPad, can I move photos from one album to another? For instance, when I edit a photo in an existing album, the photo is removed and placed in a new album with other edited photos. How do I keep it in or move it back to its original album?

    That will depend on the kind of album your photo is in.
    Most albums in iPhoto are created automatic by the way you are using and editing your photos, see: http://help.apple.com/iphoto/ipad/1.1/#blnkb9b1e2a
    When you edit your photo, the edited copy is added to the automatic "edited" album and the view switches to he edited album. But the photo should stay in its original album - do you see something different? Only if you want the edited photo in the camera roll and the photo strea as well, you have to save the edited copy to the camera roll again after editing, otherwise the camera roll will show the original and not the edted version.

  • Logic Express for news recording and editing?

    Based on the recommendation of many friends who work in public radio I bought a Digidesign M-Box 2 Mini and got ProTools to use for doing audio editing on news and spoken word projects. The thing has been a real pain in the butt causing me hundreds of system crashes and endless problems with my MacBook Pro (Late 2008). Digidesign has admitted that their M-Box driver is defective but they can't fix the current drivers 'cause they are soooo busy working on support for Snow Leopard (Which they may deliver sometime in Spring 2010). ProTools also requires that you have the M-Box connected to your system in order to launch the program.
    I'm fed up with being forced to connect a defective interface to my laptop every time I want to use ProTools and ready to try something else. Are the audio editing tools in the new Logic Express 9 good enough to use for this kind of work?
    I could almost get away with using Garage Band but it's a bit limited with support for only 16-bit audio (most news sources are pretty quiet and need boosting) and the GB interface makes me crazy.

    I think Logic is overkill for what you need - you'll never use 95% of it for recording/editing spoken word audio files.
    Although I'm not familiar with manipulating audio for news use, I'd think that something like Amadeus Pro would do the job.
    http://www.hairersoft.com/AmadeusPro/AmadeusPro.html
    with an interface such as an AudioFire like this:
    http://www.echoaudio.com/Products/FireWire/AudioFire4/index.php
    which is very good quality, reliable, and not expensive.
    BTW, recent versions of GarageBand do support 24-bit recording.
    http://support.apple.com/kb/HT1016

  • Entity Framework doesn't save new record into database

    Hy,
    I have problem with saving new record into database using Entity Framework.
    When I run program, everything seems normal, without errors . Program shows existing, manually added records into the database, and new one too. But new one isn't save into database after running program.
    I've got no idea where's problem. There is code for add new record, show existing.
    Thanks for help!!
    // add new record
    using (var db=new DatabaseEntitiesContext())
    var person = new Table()
    First_Name = "New_FName",
    Second_Name = "New_SName",
    PIN = "4569"
    db.Tables.Add(person);
    db.SaveChanges();
    //show all records
    using (var db=new DatabaseEntitiesContext())
    var selected = from x in db.Tables
    select x;
    foreach (var table in selected)
    Console.WriteLine("{0}{1}{2}",table.First_Name,table.Second_Name,table.PIN);

    Hi BownieCross;
    If you are using a local database file in your project the following may be the cause.
    From Microsoft Documentation:
    Issue:
    "Every time I test my application and modify data, my changes are gone the next time I run my application."
    Explanation:
    The value of the Copy
    to Output Directory property is Copy
    if newer or Copy
    always. The database in your output folder (the database that’s being modified when you test your application) is overwritten every
    time that you build your project. For more information, see How
    to: Manage Local Data Files in Your Project.
    Fernando (MCSD)
    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".
    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects
    and unknown namespaces.

  • 0 down vote favorite        I would like to ask the following question. I am using mac os x 10.9 maverics me quicktime player version 10.3. Can I trim a video recording without having to press the pause or save it as a file? Or can I add a new recording t

    0 down vote  favorite  
    I would like to ask the following question. I am using mac os x 10.9 maverics me quicktime player version 10.3. Can I trim a video recording without having to press the pause or save it as a file? Or can I add a new recording to a video file? Thanks in advance

    Well,
    I tried the "Internet Recovery" option and finally saw Mac OS X Mountain Lion's install page but after waiting 7 hours when I just thought its going to start installing, I got another progress bar with 36 hours remining time to download "Additional Components" then after progressing 2-3 hours, it shows "Unable to write installation something..., Contact Apple Care"
    Then I accidently rebooted the machine and now it seems Internet Recovery don't work anymore, it shows "support.apple.com - 40 something!" error, and finally when I tried to reboot using Recovery HD, I found it's gone as-well!
    To be honest, I don't know what to do now, I am and dissapointed... also I do not have any Apple Store nearby, there is an authorized country reseller almost 650/km far away from my residents and they even charges too high (like $250) for doing such repairs (as per phone conversation)
    If anyone have any idea or anything to help me with, please do share- I'd be eternally grateful!

  • Sql query to Load only new records,or update old records

    Hi,
    I need a query (not stored procedure) to insert only new records otherwise update existing records.
    I tried by creating "Merge statement in SQl", but the sql query is wrong,it is not updating,always inserting records(replicating..1,2,4,8,16,32..).
    below is my sample query,
    Here "FACT_mytbl -FCT" is my fact table.(which need to update if already records found ,otherwise insert as new records).
    *Inside select ---the table   E_tbl1,E_tbl2  is the business logic table ,using this two table only ,"FACT_mytbl" was created  .So the "S" alias will be the source
    table and "FCT" will be target table. based on this we have to insert or update records.   
      ---Query starts-------------------------------------                    
     MERGE INTO [FACT_mytbl]  FCT
     USING  (
           SELECT 
           FCT1.ID
          ,FCT1.PKcol1
          ,FCT1.FKcol1
          ,FCT1.col1
          ,FCT1.col2
         , FCT1.col3     
       FROM  [FACT_mytbl] FCT1 WITH(NOLOCK)        
       LEFT JOIN dbo.E_tbl1 CT WITH(NOLOCK)
    ON CT.PKcol1=FCT1.PKcol1
       LEFT JOIN dbo.E_tbl2 CT1 WITH(NOLOCK)
    ON CT1.PKcol1=FCT1.PKcol1
       ) S  
       ON FCT.PKcol1 = S.PKcol1 
     WHEN MATCHED AND (FCT.PKcol1 ! = S.PKcol1 ) THEN
     UPDATE SET       
           FCT.col1
          ,FCT.col2
          ,FCT.col3     
     WHEN NOT MATCHED THEN 
     INSERT VALUES
           S.ID
          ,S.PKcol1
          ,S.FKcol1
          ,S.col1
          ,S.col2
         , S.col3     
    --query ends----------------
    any suggestions,
    Thanks,
    R.B

    Hi Bhupesh_Rajasekaran,
    According to your description, if you want to insert only new records which does not exist in destination and update existing records which does exist in destination. We usually accomplish these in two statement.
    1.A join statement to update records.
    2.A insert statement for new records.
    Also we can use MERGE in SQL Server to insert, update at the same time. You specify a "Source" record set and a "Target" table, and the join between the two. You then specify the type of data modification that is to occur when the records between the two
    data are matched or are not matched. For more information, there is an similar example about merge in SQL Server, you can review the following article.
    http://www.codeproject.com/Tips/590085/Merge-in-SQL-Server
    Regards,
    Sofiya Li
    Sofiya Li
    TechNet Community Support

  • Edit existing or add new record based on key field

    Greetings and Salutations!
    I am working on an APEX 3.0 application and I need to verify a key field value to determine if the record already exists, if it does not exist, I need to add it, if it does exist, I need to update/edit it. I'm not sure how to do this, but below is what I am considering (in pseudo code):
    get the asset_tag #
    asset_search_value = :asv
    select asset_tag from asset_table were asset_tag = :asv
    IF :asv (unique key value is found) UPDATE
    else
    INSERT (create new record with asset_tag = :asv)
    ENDIF
    I hope that my explanation is clear.
    I have considered doing a function to search for a key match and if one exists, I can proceed to the UPDATE screen, otherwise, I can proceed to that INSERT screen.
    I'm intermediate with APEX and little better at pl/sql, but rapidly learning.
    I should mention that my problem is coming up with a method to see if my query returns no records.
    Thanks in advance for your assistance!
    Charles
    Message was edited by:
    cp29020

    Charles,
    You said you were thinking about creating a function to search for a key match. First, I suggest you do so in a package. A function that returns a boolean should do. Something like what follows:
    FUNCTION asset_exists (
       p_id IN TABLE_NAME.ID%TYPE
       RETURN BOOLEAN
    AS
       l_retval BOOLEAN;
       CURSOR asset_exists_test_cur
       IS
          SELECT *
          FROM table_name
          WHERE id = asset_exists.p_id;
       l_asset_exists_test ASSET_EXISTS_TEST_CUR%ROWTYPE;  
    BEGIN
       OPEN asset_exists_test_cur;
       FETCH asset_exists_test_cur INTO l_basic_user_test;
       l_retval := asset_exists_test_cur%FOUND;
       CLOSE asset_exists_test_cur;
       RETURN l_retval;
    END asset_exists;Then you can use that function as needed to branch your logic. Remember to create a unique constraint on the table if it is not the primary key or doesn't already have one.
    Dan

  • HT201436 I change my greeting every day. Each morning when I hit "Record" on the greeting window, I'm routed to Siri. The only way I can record a new greeting is through my Bluetooth ear piece. What's up?

    I change my greeting every day. Each morning when I hit "Record" on the greeting window, I'm routed to Siri. The only way I can record a new greeting is through my Bluetooth ear piece. This all started when I upgraded to OS 7. What's up?

    Start with http://www.pinkmutant.com/articles/Leopard/leospot.html and http://www.thexlab.com/faqs/stopspotlightindex.html, then my mod to Finder's Find at http://www.macosxhints.com/article.php?story=20080229204517495 for what you can change so you can find stuff excluded by the default structure.

  • Report only saves 1st 100 or so records.

    I am doing a standard device report and the report comes out fine.
    However when I want to save it as excel, excel All or any other option csv etc, only the 1st 107 records are saved.
    I can move from page to page on the screen and see 2000 record there, but saving the report does not give me all the records.
    This is a standard report and we are not using the reporting server.
    Any ideas ?

    Markvh,
    you don't say what version you're running, but check
    http://download.novell.com/patch/finder for your version, there are
    known issues with reporting only showing 100 records
    Shaun Pond

Maybe you are looking for

  • Map Webitem is not working in WAD

    Hello Experts, We are trying to implement MAP functionalities in BI. We can able to view the MAP in Bex MAP, but not in WAD. We added a MAP web item in WAD and made changes on all the required properties based on previous threads and SAP How-to-docum

  • Error during restore/recovery and 'open resetlogs'

    Hello forum. I'm attempting to restore a database to a new host and have run into an error during the opening of the database (with resetlogs). The renaming of the datafiles, restore, switching of datafiles, and recovery are all done by an rman scrip

  • Save As Function Problems

    Hi Guys I hope you can help me, I'm fairly new to the MAC version of Excel and have always previously used Windows. I recently purchased a MacBook Air and am really happy with it apart from the fact that when I try to save an Excel document to a spec

  • Q190 and TV

    My Q190 HDMI is connected to my Onkyo AVR and output to my Sharp TV hdmi. I noticed that the image was overscan with the resulting icons being partially hidden. I tried Graphics Options and Properties with no luck. The TV is 1080p i.e. 1920X1080. The

  • Remote Cubes - R3 customer exit

    Hi, We do have a situation where the enhanced fields on a SPL data source, which are filled in the R3 customer exit, do not provide data when queried on Remote cube. However when fetching data from the same datasource, using normal data extraction, d