Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Technical Issue with Records

Status
Not open for further replies.

paulnlk4

Technical User
Feb 15, 2002
15
CA
Hello,

Is there a statement in Teradata which can accomplish the following:

Insert records into a table if the record does not exist, however if the record exists, then update the record. Is there a statement like 'Insert with Update' option in TD. I heard of something similar in DB2. Please help.

Thnx
Paul
 
Hi,
yes. This was implemented in Teradata v2r4.1.

Syntax like

UPDATE Sales
SET ItemCount = ItemCount + 1
WHERE (ItemNbr = 10 AND SaleDate = ‘05/30/2000’)
ELSE INSERT
INTO Sales (10, ‘05/30/2000’, 1);

please see the SQL reference manual Volume 6 for V2r4.1.


select SQL reference then find the correct manual.
 
Thanks tdatgod, as your name suggests, u r my saviour...Paul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top