|
|
Archives of the TeradataForum
Message Posted: Thu, 02 Jun 2005 @ 15:50:54 GMT
Subj: | | Re: Source data for Multiload!!! |
|
From: | | Dennis Calkins |
| No, i need an upsert instrction. I got i used named pipes. | |
Hi,
Insert/Select has a cousin called Merge/Into which was implemented in v2r 5.0. Anyway MERGE/INTO is the UPSERT command in SQL.
Dennis.
Using ONline help.
help 'SQL MERGE';
*** Query completed. 28 rows found. One column returned.
*** Total elapsed time was 6 seconds.
On-Line Help
---------------------------------------------------------------------------
MERGE [INTO] tablename [ [AS] aname ]
{ VALUES (expr [...,expr]) }
USING { } [AS] source_tname (cname, [...,cname])
{ ( subquery ) }
ON match-condition
WHEN MATCHED THEN
UPD[ATE] SET cname = expr [...,cname = expr]
WHEN NOT MATCHED THEN
{ [VALUES] (expr [...,expr]) }
INS[ERT] { } ;
{ (cname [...,cname]) VALUES (expr [...,expr]) }
where:
The match-condition must fully specify the primary index of the
target table with equality constraints.
The subquery variant in the USING clause must fully specify the unique
primary index, or a unique secondary index, with equality constraints
so as to ensure that the subquery returns a single row at most.
Either the WHEN MATCHED or the WHEN NOT MATCHED clause may be
omitted as long as the other clause of the pair is present.
BTEQ -- Enter your DBC/SQL request or BTEQ command:
| |