Email1 came before email2 and shouldn't have
Rob Berendt
Received: from mail165.messagelabs.com ([216.82.253.147])
by NS1.dekko.com (Lotus Domino Release 8.5.1FP3)
with ESMTP id 2010081814142197-3907 ;
Wed, 18 Aug 2010 14:14:21 -0400
X-VirusChecked: Checked
X-Env-Sender: midrange-l-bounces@xxxxxxxxxxxx
X-Msg-Ref: server-15.tower-165.messagelabs.com!1282155257!32584672!1
X-StarScan-Version: 6.2.4; banners=-,-,-
X-Originating-IP: [69.3.23.26]
X-SpamReason: No, hits=0.0 required=7.0 tests=
Received: (qmail 27299 invoked from network); 18 Aug 2010 18:14:18 -0000
Received: from mailout.midrange.com (HELO mailout.midrange.com) (69.3.23.26)
by server-15.tower-165.messagelabs.com with DHE-RSA-AES256-SHA encrypted SMTP; 18 Aug 2010 18:14:18 -0000
Received: from rivendell.midrange.com (localhost [127.0.0.1])
by mailout.midrange.com (8.14.3/8.14.3) with ESMTP id o7IIAQSY029629;
Wed, 18 Aug 2010 13:10:26 -0500
X-DomainKeys: Sendmail DomainKeys Filter v1.0.0 mailout.midrange.com o7IIAQSY029629
DomainKey-Signature: a=rsa-sha1; s=dk; d=midrange.com; c=simple; q=dns;
b=RC4PTCj90UgsCgCTduaibU+c2XgVWFmgn6ILJ/xah2CKmo4Bfd5FVibDEEGwZEu+6
ZnLzsuqrB4nXcnn0p7NPg==
X-DKIM: Sendmail DKIM Filter v2.8.3 mailout.midrange.com o7IIAQSY029629
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=midrange.com;
s=midrange; t=1282155051;
bh=googI823bMuKJSe3Bn0itsT7MX79GiAbTs/ejrn2F8M=;
h=MIME-Version:Subject:Date:Message-ID:In-Reply-To:References:From:
To:Reply-To:List-Id:List-Unsubscribe:List-Archive:List-Post:
List-Help:List-Subscribe:Content-Type:Content-Transfer-Encoding:
Sender;
b=Yf3DZPfTQ9hmzX2ri7NLljDK8f9HjjdNwRSAhNLNVFxwk+jkj7jxqCekhWUXIoWPG
lYt529FeTtBJ4RRkIX+tDzCqKLoot6W9u5QCRJzT+nY9NcIKOr3kuEOgO+yn+SEz1v
7Ytr9KjrGSXqo0pzqq8y3sL2Zl3bJbqexm/FGwtk=
Received: from mail.rgcweb.org (wsip-98-190-207-47.rn.hr.cox.net
[98.190.207.47])
by mailout.midrange.com (8.14.3/8.14.3) with ESMTP id o7IIAFxf029533
for <midrange-l@xxxxxxxxxxxx>; Wed, 18 Aug 2010 13:10:21 -0500
Received: from mail.rgcweb.org ([192.168.0.17]) by mail.rgcweb.org with
Microsoft SMTPSVC(6.0.3790.4675); Wed, 18 Aug 2010 14:11:42 -0400
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.4657
MIME-Version: 1.0
Subject: RE: Multiple condition sql
Date: Wed, 18 Aug 2010 14:11:43 -0400
Message-ID: <B369FBDD3799E14CB310EF780B6EBC7B050B578C@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
In-Reply-To: <5AF028844A375D4B98FDCB0627C9AA19064B7BD5@xxxxxxxxxxxxxxxxxxxxxxx>
Importance: Normal
X-MS-Has-Attach:
Priority: normal
X-MS-TNEF-Correlator:
Thread-Topic: Multiple condition sql
Thread-Index: Acs++/eyqiRyjHsyRW2qpnw3HiqvNAAAevnQAAC1xYA=
References: <B369FBDD3799E14CB310EF780B6EBC7B050B5789@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
<5AF028844A375D4B98FDCB0627C9AA19064B7BD5@xxxxxxxxxxxxxxxxxxxxxxx>
From: "Smith, Mike" <Mike_Smith@xxxxxxxxxxxxxxxx>
To: "Midrange Systems Technical Discussion" <midrange-l@xxxxxxxxxxxx>
X-OriginalArrivalTime: 18 Aug 2010 18:11:42.0980 (UTC)
FILETIME=[CFD84C40:01CB3F00]
X-Virus-Scanned: clamav-milter 0.96.1 at rivendell.midrange.com
X-Virus-Status: Clean
X-BeenThere: midrange-l@xxxxxxxxxxxx
X-Mailman-Version: 2.1.9
Precedence: list
Reply-To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>
List-Id: Midrange Systems Technical Discussion <midrange-l.midrange.com>
Auto-Submitted: auto-generated
List-Unsubscribe: <
http://lists.midrange.com/mailman/listinfo/midrange-l>,
<mailto:midrange-l-request@xxxxxxxxxxxx?subject=unsubscribe>
List-Archive: <
http://archive.midrange.com/midrange-l>
List-Post: <mailto:midrange-l@xxxxxxxxxxxx>
List-Help: <mailto:midrange-l-request@xxxxxxxxxxxx?subject=help>
List-Subscribe: <
http://lists.midrange.com/mailman/listinfo/midrange-l>,
<mailto:midrange-l-request@xxxxxxxxxxxx?subject=subscribe>
Sender: midrange-l-bounces@xxxxxxxxxxxx
Errors-To: midrange-l-bounces@xxxxxxxxxxxx
X-MIMETrack: Itemize by SMTP Server on INTERNOTES/DEKKO(Release 8.5.1FP3|May 23, 2010) at
08/18/2010 14:14:22,
Serialize by Notes Client on Rob Berendt/DEKKO(Release 8.5.1 FP3|May 24, 2010) at
08/18/2010 02:42:29 PM,
Serialize complete at 08/18/2010 02:42:29 PM
Content-Transfer-Encoding: 7bit
Content-class: urn:content-classes:message
Content-Type: text/plain; charset="us-ascii"
Thanks Paul
I have never used 'case' in an SQL statement.
Mike
-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Morgan, Paul
Sent: Wednesday, August 18, 2010 1:59 PM
To: Midrange Systems Technical Discussion
Subject: RE: Multiple condition sql
Something like this will update all three fields on all records. If the
flag isn't set that field is updated with the same value:
update contract_file
Set emp = case when empflag = 'Y'
then newUser
else emp
end,
contact1 = case when contflag1 = 'Y'
then newUser
else contact1
end,
contact2 = case when contflag2 = 'Y'
then newUser
else contact2
end
Paul Morgan
Principal Programmer Analyst
IS Supply Chain/Replenishment
-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Smith, Mike
Sent: Wednesday, August 18, 2010 1:37 PM
To: Midrange Systems Technical Discussion
Subject: Multiple condition sql
I'm trying to figure out if the following 3 sql statements can be
combined into 1 statement.
I'm trying to update 1 file and set specific field based on flagged
variables from a display file.
Update contract_file set emp = newUser where empflag = 'Y'
Update contract_file set contact1 = newUser where contflag1 = 'Y'
Update contract_file set contact2 = newUser where contflag2 = 'Y'
Thanks
Mike
NOTICE: This message, including any attachment, is intended as a
confidential and privileged communication. If you have received this
message in error, or are not the named recipient(s), please immediately
notify the sender and delete this message.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives at
http://archive.midrange.com/midrange-l.
Received: from mail75.messagelabs.com ([216.82.250.3])
by NS1.dekko.com (Lotus Domino Release 8.5.1FP3)
with ESMTP id 2010081814150319-3910 ;
Wed, 18 Aug 2010 14:15:03 -0400
X-VirusChecked: Checked
X-Env-Sender: midrange-l-bounces@xxxxxxxxxxxx
X-Msg-Ref: server-11.tower-75.messagelabs.com!1282155300!50587909!1
X-StarScan-Version: 6.2.4; banners=-,-,-
X-Originating-IP: [69.3.23.26]
X-SpamReason: No, hits=0.0 required=7.0 tests=
Received: (qmail 20171 invoked from network); 18 Aug 2010 18:15:01 -0000
Received: from mailout.midrange.com (HELO mailout.midrange.com) (69.3.23.26)
by server-11.tower-75.messagelabs.com with DHE-RSA-AES256-SHA encrypted SMTP; 18 Aug 2010 18:15:01 -0000
Received: from rivendell.midrange.com (localhost [127.0.0.1])
by mailout.midrange.com (8.14.3/8.14.3) with ESMTP id o7IHxa7e026939;
Wed, 18 Aug 2010 12:59:36 -0500
X-DomainKeys: Sendmail DomainKeys Filter v1.0.0 mailout.midrange.com o7IHxa7e026939
DomainKey-Signature: a=rsa-sha1; s=dk; d=midrange.com; c=simple; q=dns;
b=JDkhpnXO/FHVaGgGeov4uFK5IDrfnsrgG+EyNrqkZNebz6nyVByiQXHh4ZieIywKT
UEVVzhpddzDkzRzT3MuCg==
X-DKIM: Sendmail DKIM Filter v2.8.3 mailout.midrange.com o7IHxa7e026939
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=midrange.com;
s=midrange; t=1282154402;
bh=V9jeQsA7SIt8BxJd8VjjXc+8f9+bDo8WesabMdHvaSQ=;
h=MIME-Version:Subject:Date:Message-ID:In-Reply-To:References:From:
To:Reply-To:List-Id:List-Unsubscribe:List-Archive:List-Post:
List-Help:List-Subscribe:Content-Type:Content-Transfer-Encoding:
Sender;
b=dEuy7X7V0BdLXWmj2Lne2SvWtD9WAyu4f9hRHpXmtGpZTdc1r7NW0Yxj6LOXhJ214
nFEzeOwHvYbmvGIwL62e8MKQZ64JzwSXnnfZTY9sTYt2VdtVSza3nkGstucfDQB/TL
V5Fu+oMo/gA9SUkkPyqXJ1BrBBZyyvJSglbkH0b0=
Received: from TX2EHSOBE003.bigfish.com (tx2ehsobe002.messaging.microsoft.com
[65.55.88.12])
by mailout.midrange.com (8.14.3/8.14.3) with ESMTP id o7IHwwOo026699
for <midrange-l@xxxxxxxxxxxx>; Wed, 18 Aug 2010 12:59:03 -0500
Received: from mail178-tx2-R.bigfish.com (10.9.14.237) by
TX2EHSOBE003.bigfish.com (10.9.40.23) with Microsoft SMTP Server id
8.1.340.0; Wed, 18 Aug 2010 17:58:51 +0000
Received: from mail178-tx2 (localhost.localdomain [127.0.0.1]) by
mail178-tx2-R.bigfish.com (Postfix) with ESMTP id 4E3711208424 for
<midrange-l@xxxxxxxxxxxx>; Wed, 18 Aug 2010 17:58:51 +0000 (UTC)
X-SpamScore: -18
X-BigFish: VPS-18(zz542N62a3L9371Pzz1202hzz8275bhz2fh43h61h)
X-Spam-TCS-SCL: 0:0
Received: from mail178-tx2 (localhost.localdomain [127.0.0.1]) by mail178-tx2
(MessageSwitch) id 1282154330363443_12523;
Wed, 18 Aug 2010 17:58:50 +0000 (UTC)
Received: from TX2EHSMHS049.bigfish.com (unknown [10.9.14.238]) by
mail178-tx2.bigfish.com (Postfix) with ESMTP id 55AFF14D8077 for
<midrange-l@xxxxxxxxxxxx>; Wed, 18 Aug 2010 17:58:50 +0000 (UTC)
Received: from fraexsmtp4.staples.com (12.40.61.103) by
TX2EHSMHS049.bigfish.com (10.9.99.149) with Microsoft SMTP Server id
14.0.482.44; Wed, 18 Aug 2010 17:58:49 +0000
Received: from fraexsmtp2.staplesams.com ([10.3.32.143]) by
fraexsmtp4.staples.com with Microsoft SMTPSVC(6.0.3790.4675);
Wed, 18 Aug 2010 13:58:49 -0400
Received: from nedexmb1.staplesams.com ([10.4.18.109]) by
fraexsmtp2.staplesams.com with Microsoft SMTPSVC(6.0.3790.4675);
Wed, 18 Aug 2010 13:58:49 -0400
X-MimeOLE: Produced By Microsoft Exchange V6.5
MIME-Version: 1.0
Subject: RE: Multiple condition sql
Date: Wed, 18 Aug 2010 13:58:47 -0400
Message-ID: <5AF028844A375D4B98FDCB0627C9AA19064B7BD5@xxxxxxxxxxxxxxxxxxxxxxx>
In-Reply-To: <B369FBDD3799E14CB310EF780B6EBC7B050B5789@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
Thread-Topic: Multiple condition sql
Thread-Index: Acs++/eyqiRyjHsyRW2qpnw3HiqvNAAAevnQ
References: <B369FBDD3799E14CB310EF780B6EBC7B050B5789@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
From: "Morgan, Paul" <Paul.Morgan@xxxxxxxxxxx>
To: "Midrange Systems Technical Discussion" <midrange-l@xxxxxxxxxxxx>
X-OriginalArrivalTime: 18 Aug 2010 17:58:49.0147 (UTC)
FILETIME=[029AC0B0:01CB3EFF]
X-Reverse-DNS: unknown
X-Virus-Scanned: clamav-milter 0.96.1 at rivendell.midrange.com
X-Virus-Status: Clean
X-BeenThere: midrange-l@xxxxxxxxxxxx
X-Mailman-Version: 2.1.9
Precedence: list
Reply-To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>
List-Id: Midrange Systems Technical Discussion <midrange-l.midrange.com>
Auto-Submitted: auto-generated
List-Unsubscribe: <
http://lists.midrange.com/mailman/listinfo/midrange-l>,
<mailto:midrange-l-request@xxxxxxxxxxxx?subject=unsubscribe>
List-Archive: <
http://archive.midrange.com/midrange-l>
List-Post: <mailto:midrange-l@xxxxxxxxxxxx>
List-Help: <mailto:midrange-l-request@xxxxxxxxxxxx?subject=help>
List-Subscribe: <
http://lists.midrange.com/mailman/listinfo/midrange-l>,
<mailto:midrange-l-request@xxxxxxxxxxxx?subject=subscribe>
Sender: midrange-l-bounces@xxxxxxxxxxxx
Errors-To: midrange-l-bounces@xxxxxxxxxxxx
X-MIMETrack: Itemize by SMTP Server on INTERNOTES/DEKKO(Release 8.5.1FP3|May 23, 2010) at
08/18/2010 14:15:03,
Serialize by Notes Client on Rob Berendt/DEKKO(Release 8.5.1 FP3|May 24, 2010) at
08/18/2010 02:43:39 PM,
Serialize complete at 08/18/2010 02:43:39 PM
Content-Transfer-Encoding: 7bit
Content-Class: urn:content-classes:message
Content-Type: text/plain; charset="us-ascii"
Something like this will update all three fields on all records. If the flag isn't set that field is updated with the same value:
update contract_file
Set emp = case when empflag = 'Y'
then newUser
else emp
end,
contact1 = case when contflag1 = 'Y'
then newUser
else contact1
end,
contact2 = case when contflag2 = 'Y'
then newUser
else contact2
end
Paul Morgan
Principal Programmer Analyst
IS Supply Chain/Replenishment
-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Smith, Mike
Sent: Wednesday, August 18, 2010 1:37 PM
To: Midrange Systems Technical Discussion
Subject: Multiple condition sql
I'm trying to figure out if the following 3 sql statements can be
combined into 1 statement.
I'm trying to update 1 file and set specific field based on flagged
variables from a display file.
Update contract_file set emp = newUser where empflag = 'Y'
Update contract_file set contact1 = newUser where contflag1 = 'Y'
Update contract_file set contact2 = newUser where contflag2 = 'Y'
Thanks
Mike
NOTICE: This message, including any attachment, is intended as a confidential and privileged communication. If you have received this message in error, or are not the named recipient(s), please immediately notify the sender and delete this message.
As an Amazon Associate we earn from qualifying purchases.