Return-Path: X-Original-To: apmail-db-derby-dev-archive@www.apache.org Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 824D010D91 for ; Thu, 27 Feb 2014 17:51:30 +0000 (UTC) Received: (qmail 53481 invoked by uid 500); 27 Feb 2014 17:51:28 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 53466 invoked by uid 500); 27 Feb 2014 17:51:28 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 53374 invoked by uid 99); 27 Feb 2014 17:51:24 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Feb 2014 17:51:24 +0000 Date: Thu, 27 Feb 2014 17:51:24 +0000 (UTC) From: "ASF subversion and git services (JIRA)" To: derby-dev@db.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (DERBY-3155) Support for SQL:2003 MERGE statement MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/DERBY-3155?page=3Dcom.atlassian= .jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D1391= 4792#comment-13914792 ]=20 ASF subversion and git services commented on DERBY-3155: -------------------------------------------------------- Commit 1572665 from [~rhillegas] in branch 'code/trunk' [ https://svn.apache.org/r1572665 ] DERBY-3155: Enforce correct privileges for DELETE actions of MERGE statemen= ts; tests passed cleanly on derby-3155-31-aa-deletePrivs.diff. > Support for SQL:2003 MERGE statement > ------------------------------------ > > Key: DERBY-3155 > URL: https://issues.apache.org/jira/browse/DERBY-3155 > Project: Derby > Issue Type: Improvement > Components: SQL > Reporter: Trejkaz > Assignee: Rick Hillegas > Labels: derby_triage10_10 > Attachments: MergeStatement.html, MergeStatement.html, MergeState= ment.html, MergeStatement.html, derby-3155-01-ac-grammar.diff, derby-3155-0= 2-ag-fixParserWarning.diff, derby-3155-03-ae-backingStoreHashtableWithRowLo= cation.diff, derby-3155-03-af-backingStoreHashtableWithRowLocation.diff, de= rby-3155-03-ag-backingStoreHashtableWithRowLocation.diff, derby-3155-03-ah-= backingStoreHashtableWithRowLocation.diff, derby-3155-04-ae-deleteAction.di= ff, derby-3155-04-af-deleteAction.diff, derby-3155-05-aa-triggerTransitionT= ableAsTarget.diff, derby-3155-06-aa-triggerTransitionTableAsSource.diff, de= rby-3155-07-ad-insertAction.diff, derby-3155-08-ah-updateAction.diff, derby= -3155-09-aa-correlationNames.diff, derby-3155-10-aa-correlationNames.diff, = derby-3155-11-ab-beforeTriggersCantFireMerge.diff, derby-3155-12-aa-canOmit= InsertColumnList.diff, derby-3155-13-aa-allowSystemAndTempTables.diff, derb= y-3155-14-aa-replaceCorrelationNamesOnLeftSideOfSETclauses.diff, derby-3155= -15-aa-replumbMergeResultSetCleanup.diff, derby-3155-16-aa-treatCurrentRowL= ocationNodeLikeBaseColumnNode.diff, derby-3155-17-aa-serializingRowLocation= s.diff, derby-3155-18-aa-basicView.diff, derby-3155-19-aa-forbidSubqueriesI= nMatchedClauses.diff, derby-3155-20-aa-reworkColumnMatching.diff, derby-315= 5-21-ac-cleanupAndForbidSynonyms.diff, derby-3155-22-ad-testIdentifiersOnLe= ftSideOfSetClauses.diff, derby-3155-23-aa-forbidDerivedColumnLists.diff, de= rby-3155-24-aa-supportParameters.diff, derby-3155-25-aa-parametersAsInsertV= alues.diff, derby-3155-26-aa-copyRowLocationForIndexScans.diff, derby-3155-= 27-aa-adjustMatchingRefinements.diff, derby-3155-28-aa-cardinalityViolation= s.diff, derby-3155-29-aa-missingSchema.diff, derby-3155-30-ab-moreCorrelati= onNames.diff, derby-3155-31-aa-deletePrivs.diff > > > A relatively common piece of logic in a database application is to check = for a row's existence and then either update or insert depending on its exi= stence. > SQL:2003 added a MERGE statement to perform this operation. It looks lik= e this: > MERGE INTO table_name USING table_name ON (condition) > WHEN MATCHED THEN UPDATE SET column1 =3D value1 [, column2 =3D value2= ...] > WHEN NOT MATCHED THEN INSERT column1 [, column2 ...] VALUES (value1 [= , value2 ...])=20 > At the moment, the only workaround for this would be to write a stored pr= ocedure to do the same operation, or to implement the logic client-side. -- This message was sent by Atlassian JIRA (v6.1.5#6160)