Message-ID: <3D9EA53CDE9BBF40ADB2096F4784910F21772FD6EA@CBMCC-X7-MBX02.ad.cibc.com>
Date: 2012-11-07T14:37:06Z
From: Bond, Stephen
Subject: RODBC to MS SQL Server update error
Is this a bug:
Trying to update when the where condition gives zero rows throws an error on MS SQL server
> sqlQuery(pipe,"select * from ComDetailCurrent where RateTypeId is null;")
[1] ProcessDate SourceSystemId AccountNumber Xref1
<0 rows> (or 0-length row.names)
sqlQuery(pipe,"update ComDetailCurrent set RateTypeId=1 where RateTypeId is null;")
[1] "[RODBC] ERROR: Could not SQLExecDirect 'update ComDetailCurrent set RateTypeId=1 where RateTypeId is null;'"
On the other hand with MySQL
> sqlQuery(mys,"update rate_hist set val=5.0 where dtend<'1986-05-01'")
[1] "No Data"
Please, try to update a table on SQL server and give it a where condition such that zero rows will be updated. And post the result on this forum :-)
Thanks everybody and have a great day.
Stephen B