Questions tagged [insert-update]
A mixed flavour of data entry mode and data modification mode. It can be used when insert is required for case of non-existing data and modification if data exists.
insert-update
1,310
questions
44
votes
5
answers
72k
views
Does DB2 have an "insert or update" statement?
From my code (Java) I want to ensure that a row exists in the database (DB2) after my code is executed.
My code now does a select and if no result is returned it does an insert. I really don't like ...
12
votes
7
answers
36k
views
How do I Insert or Update (or overwrite) a record using NHibernate?
I need to write a row to the database regardless of whether it already exists or not. Before using NHibernate this was done with a stored procedure. The procedure would attempt an update and if no ...
49
votes
7
answers
26k
views
Is there a way to do an "INSERT...ON DUPLICATE KEY UPDATE" in Zend Framework 1.5?
I would like to use ON DUPLICATE KEY UPDATE in Zend Framework 1.5, is this possible?
Example
INSERT INTO sometable (...)
VALUES (...)
ON DUPLICATE KEY UPDATE ...
2
votes
4
answers
10k
views
Insert/Update on SQL Server 2005 without using Stored Procedures
I'm trying to do the classic Insert/Update scenario where I need to update existing rows in a database or insert them if they are not there.
I've found a previous question on the subject, but it ...
6
votes
5
answers
2k
views
SQL - Table Design - DateCreated and DateUpdated columns
For my application there are several entity classes, User, Customer, Post, and so on
I'm about to design the database and I want to store the date when the entities were created and updated. This is ...