I'm trying to UPDATE multiple rows in a single statement. I've seen some examples but to me they don't seem to apply to my scenario. Below is my original SQL:
UPDATE AIM.AIMRetrieve dItem
SET ImageFront=NULL ,
ImageFrontSize= NULL,
ImageFrontType= NULL,
ImageBack=NULL,
ImageBackSize=N ULL,
ImageBackType=N ULL
WHERE AIM.AIMRetrieve dItem.ArchiveRe trievalID = (SELECT
AIM.AIMRETRIEVE DITEM.ARCHIVERE TRIEVALID
FROM
AIM.ARCHIVERETR IEVAL,
AIM.AIMRETRIEVE DITEM
WHERE
AIM.AIMRETRIEVE DITEM.ARCHIVERE TRIEVALID = AIM.ARCHIVERETR IEVAL.ARCHIVERE TRIEVALID
AND AIM.ARCHIVERETR IEVAL.EXPIRATIO NDATE < DATE(CURRENT TIMESTAMP))
When I run this query, I get the multiple recordset error.
I would welcome any suggestions or ideas on how to rectify the problem.
Thanks in advance... 10 13016
"Anthony Robinison" <an*****@yahoo. com> wrote in message
news:e9******** *********@twist er.rdc-kc.rr.com...
I'm trying to UPDATE multiple rows in a single statement. I've seen some
examples but to me they don't seem to apply to my scenario. Below is my
original SQL:
UPDATE AIM.AIMRetrieve dItem
SET ImageFront=NULL ,
ImageFrontSize= NULL,
ImageFrontType= NULL,
ImageBack=NULL,
ImageBackSize=N ULL,
ImageBackType=N ULL
WHERE AIM.AIMRetrieve dItem.ArchiveRe trievalID = (SELECT
AIM.AIMRETRIEVE DITEM.ARCHIVERE TRIEVALID
FROM
AIM.ARCHIVERETR IEVAL,
AIM.AIMRETRIEVE DITEM
WHERE
AIM.AIMRETRIEVE DITEM.ARCHIVERE TRIEVALID =
AIM.ARCHIVERETR IEVAL.ARCHIVERE TRIEVALID
AND AIM.ARCHIVERETR IEVAL.EXPIRATIO NDATE < DATE(CURRENT TIMESTAMP))
When I run this query, I get the multiple recordset error.
I would welcome any suggestions or ideas on how to rectify the problem.
Thanks in advance...
-------------------------------------------------
I suspect that the problem is in the subselect, which is returning more than
one value.
"Anthony Robinison" <an*****@yahoo. com> wrote in message
news:e9******** *********@twist er.rdc-kc.rr.com...
I'm trying to UPDATE multiple rows in a single statement. I've seen some
examples but to me they don't seem to apply to my scenario. Below is my
original SQL:
UPDATE AIM.AIMRetrieve dItem
SET ImageFront=NULL ,
ImageFrontSize= NULL,
ImageFrontType= NULL,
ImageBack=NULL,
ImageBackSize=N ULL,
ImageBackType=N ULL
WHERE AIM.AIMRetrieve dItem.ArchiveRe trievalID = (SELECT
AIM.AIMRETRIEVE DITEM.ARCHIVERE TRIEVALID
FROM
AIM.ARCHIVERETR IEVAL,
AIM.AIMRETRIEVE DITEM
WHERE
AIM.AIMRETRIEVE DITEM.ARCHIVERE TRIEVALID =
AIM.ARCHIVERETR IEVAL.ARCHIVERE TRIEVALID
AND AIM.ARCHIVERETR IEVAL.EXPIRATIO NDATE < DATE(CURRENT TIMESTAMP))
When I run this query, I get the multiple recordset error.
I would welcome any suggestions or ideas on how to rectify the problem.
Thanks in advance...
-------------------------------------------------
I suspect that the problem is in the subselect, which is returning more than
one value.
I've seen examples where they were able to get around the more than one
record issue...
Anyone seen this or have any ideas?
"Mark A" <ma@switchboard .net> wrote in message
news:gf******** *********@news. uswest.net... "Anthony Robinison" <an*****@yahoo. com> wrote in message news:e9******** *********@twist er.rdc-kc.rr.com... I'm trying to UPDATE multiple rows in a single statement. I've seen some examples but to me they don't seem to apply to my scenario. Below is my original SQL:
UPDATE AIM.AIMRetrieve dItem SET ImageFront=NULL , ImageFrontSize= NULL, ImageFrontType= NULL, ImageBack=NULL, ImageBackSize=N ULL, ImageBackType=N ULL WHERE AIM.AIMRetrieve dItem.ArchiveRe trievalID = (SELECT AIM.AIMRETRIEVE DITEM.ARCHIVERE TRIEVALID FROM AIM.ARCHIVERETR IEVAL, AIM.AIMRETRIEVE DITEM WHERE AIM.AIMRETRIEVE DITEM.ARCHIVERE TRIEVALID = AIM.ARCHIVERETR IEVAL.ARCHIVERE TRIEVALID AND AIM.ARCHIVERETR IEVAL.EXPIRATIO NDATE < DATE(CURRENT TIMESTAMP))
When I run this query, I get the multiple recordset error.
I would welcome any suggestions or ideas on how to rectify the problem.
Thanks in advance... ------------------------------------------------- I suspect that the problem is in the subselect, which is returning more
than one value.
I've seen examples where they were able to get around the more than one
record issue...
Anyone seen this or have any ideas?
"Mark A" <ma@switchboard .net> wrote in message
news:gf******** *********@news. uswest.net... "Anthony Robinison" <an*****@yahoo. com> wrote in message news:e9******** *********@twist er.rdc-kc.rr.com... I'm trying to UPDATE multiple rows in a single statement. I've seen some examples but to me they don't seem to apply to my scenario. Below is my original SQL:
UPDATE AIM.AIMRetrieve dItem SET ImageFront=NULL , ImageFrontSize= NULL, ImageFrontType= NULL, ImageBack=NULL, ImageBackSize=N ULL, ImageBackType=N ULL WHERE AIM.AIMRetrieve dItem.ArchiveRe trievalID = (SELECT AIM.AIMRETRIEVE DITEM.ARCHIVERE TRIEVALID FROM AIM.ARCHIVERETR IEVAL, AIM.AIMRETRIEVE DITEM WHERE AIM.AIMRETRIEVE DITEM.ARCHIVERE TRIEVALID = AIM.ARCHIVERETR IEVAL.ARCHIVERE TRIEVALID AND AIM.ARCHIVERETR IEVAL.EXPIRATIO NDATE < DATE(CURRENT TIMESTAMP))
When I run this query, I get the multiple recordset error.
I would welcome any suggestions or ideas on how to rectify the problem.
Thanks in advance... ------------------------------------------------- I suspect that the problem is in the subselect, which is returning more
than one value.
Anthony Robinison wrote: I'm trying to UPDATE multiple rows in a single statement. I've seen some examples but to me they don't seem to apply to my scenario. Below is my original SQL:
*/UPDATE AIM.AIMRetrieve dItem SET ImageFront=NULL , ImageFrontSize= NULL, ImageFrontType= NULL, ImageBack=NULL, ImageBackSize=N ULL, ImageBackType=N ULL WHERE AIM.AIMRetrieve dItem.ArchiveRe trievalID = (SELECT AIM.AIMRETRIEVE DITEM.ARCHIVERE TRIEVALID FROM AIM.ARCHIVERETR IEVAL, AIM.AIMRETRIEVE DITEM WHERE AIM.AIMRETRIEVE DITEM.ARCHIVERE TRIEVALID = AIM.ARCHIVERETR IEVAL.ARCHIVERE TRIEVALID AND AIM.ARCHIVERETR IEVAL.EXPIRATIO NDATE < DATE(CURRENT TIMESTAMP))/* *//* When I run this query, I get the multiple recordset error.
I would welcome any suggestions or ideas on how to rectify the problem.
Thanks in advance...
....
WHERE AIM.AIMRetrieve dItem.ArchiveRe trievalID in (select ...)
Good luck,
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =----- http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
Anthony Robinison wrote: I'm trying to UPDATE multiple rows in a single statement. I've seen some examples but to me they don't seem to apply to my scenario. Below is my original SQL:
*/UPDATE AIM.AIMRetrieve dItem SET ImageFront=NULL , ImageFrontSize= NULL, ImageFrontType= NULL, ImageBack=NULL, ImageBackSize=N ULL, ImageBackType=N ULL WHERE AIM.AIMRetrieve dItem.ArchiveRe trievalID = (SELECT AIM.AIMRETRIEVE DITEM.ARCHIVERE TRIEVALID FROM AIM.ARCHIVERETR IEVAL, AIM.AIMRETRIEVE DITEM WHERE AIM.AIMRETRIEVE DITEM.ARCHIVERE TRIEVALID = AIM.ARCHIVERETR IEVAL.ARCHIVERE TRIEVALID AND AIM.ARCHIVERETR IEVAL.EXPIRATIO NDATE < DATE(CURRENT TIMESTAMP))/* *//* When I run this query, I get the multiple recordset error.
I would welcome any suggestions or ideas on how to rectify the problem.
Thanks in advance...
....
WHERE AIM.AIMRetrieve dItem.ArchiveRe trievalID in (select ...)
Good luck,
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =----- http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
I can't believe it was that easy!!! Why didn't I think of that - I was
making it way too complicated...
Thanks Ian!
"Ian" <ia*****@mobile audio.com> wrote in message
news:40******** **@corp.newsgro ups.com... Anthony Robinison wrote:
I'm trying to UPDATE multiple rows in a single statement. I've seen some examples but to me they don't seem to apply to my scenario. Below is my original SQL:
*/UPDATE AIM.AIMRetrieve dItem SET ImageFront=NULL , ImageFrontSize= NULL, ImageFrontType= NULL, ImageBack=NULL, ImageBackSize=N ULL, ImageBackType=N ULL WHERE AIM.AIMRetrieve dItem.ArchiveRe trievalID = (SELECT AIM.AIMRETRIEVE DITEM.ARCHIVERE TRIEVALID FROM AIM.ARCHIVERETR IEVAL, AIM.AIMRETRIEVE DITEM WHERE AIM.AIMRETRIEVE DITEM.ARCHIVERE TRIEVALID = AIM.ARCHIVERETR IEVAL.ARCHIVERE TRIEVALID AND AIM.ARCHIVERETR IEVAL.EXPIRATIO NDATE < DATE(CURRENT TIMESTAMP))/* *//* When I run this query, I get the multiple recordset error.
I would welcome any suggestions or ideas on how to rectify the problem.
Thanks in advance...
... WHERE AIM.AIMRetrieve dItem.ArchiveRe trievalID in (select ...)
Good luck, -----= Posted via Newsfeeds.Com, Uncensored Usenet News =----- http://www.newsfeeds.com - The #1 Newsgroup Service in the World! -----== Over 100,000 Newsgroups - 19 Different Servers! =-----
I can't believe it was that easy!!! Why didn't I think of that - I was
making it way too complicated...
Thanks Ian!
"Ian" <ia*****@mobile audio.com> wrote in message
news:40******** **@corp.newsgro ups.com... Anthony Robinison wrote:
I'm trying to UPDATE multiple rows in a single statement. I've seen some examples but to me they don't seem to apply to my scenario. Below is my original SQL:
*/UPDATE AIM.AIMRetrieve dItem SET ImageFront=NULL , ImageFrontSize= NULL, ImageFrontType= NULL, ImageBack=NULL, ImageBackSize=N ULL, ImageBackType=N ULL WHERE AIM.AIMRetrieve dItem.ArchiveRe trievalID = (SELECT AIM.AIMRETRIEVE DITEM.ARCHIVERE TRIEVALID FROM AIM.ARCHIVERETR IEVAL, AIM.AIMRETRIEVE DITEM WHERE AIM.AIMRETRIEVE DITEM.ARCHIVERE TRIEVALID = AIM.ARCHIVERETR IEVAL.ARCHIVERE TRIEVALID AND AIM.ARCHIVERETR IEVAL.EXPIRATIO NDATE < DATE(CURRENT TIMESTAMP))/* *//* When I run this query, I get the multiple recordset error.
I would welcome any suggestions or ideas on how to rectify the problem.
Thanks in advance...
... WHERE AIM.AIMRetrieve dItem.ArchiveRe trievalID in (select ...)
Good luck, -----= Posted via Newsfeeds.Com, Uncensored Usenet News =----- http://www.newsfeeds.com - The #1 Newsgroup Service in the World! -----== Over 100,000 Newsgroups - 19 Different Servers! =-----
Also take a look at the MERGE statement. It doesn't require the double
select
Cheers
Serge
--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Rima |
last post by:
I have the following two tables :
table a
(commit_id,
capital_market_id,
chg_lst_date
)
table b
(b_seq_id,
|
by: Dave |
last post by:
I have 2 tables, one with names, and another with addresses, joined by their
CIVICID number (unique to the ADDRESSINFO table) in Oracle.
I need to update a field in the NAMEINFO table for a particular surname in a
particular town.
I can select the records fine with this syntax (testing in Oracle SQL* Plus)
SELECT NAMEINFO.LASTNAME, NAMEINFO.FIRSTNAME, NAMEINFO.MIDDLENAME,
NAMEINFO.GENDER, ADDRESSINFO.REGION FROM NAMEINFO, ADDRESSINFO...
|
by: Lauren Quantrell |
last post by:
In VBA, I constructed the following to update all records in
tblmyTable with each records in tblmyTableTEMP having the same
UniqueID:
UPDATE
tblMyTable RIGHT JOIN tblMyTableTEMP ON tblMyTable.UniqueID =
tblMyTableTEMP.UniqueID
SET
tblMyTable.myField = tblMyTableTEMP.myField,
tblMyTable.myField2 = tblMyTableTEMP.myField2,
|
by: Jason |
last post by:
I have a table that matches up Securities and Exchanges. Individual
securities can belong on multiple exchanges. One of the columns, named
PrimaryExchangeFlag, indicates if a particular exchange is the primary
exchange for that symbol. Each symbol can only have one primary
exchange.
I am trying to write a insert/update/delete trigger that enforces this
rule. The rules I have thought of are as follows:
Insert If new row has flag...
|
by: Bill Smith |
last post by:
The initial row is inserted with the colPartNum column containing a valid
LIKE pattern, such as (without the single quotes) 'AB%DE'.
I want to update the column value with the results of a query against a
different table (that uses the LIKE predicate) but cannot get around the
SQL0132 error .
I have tried the hex notation after the LIKE such as (without the
quotes)...
" where colNewPartNum like ( X'27' || nnn.colPartNum || X'27) " ,...
| |
by: Christopher |
last post by:
Greetings,
Fairly new to c# and Im looking for pointers on a few topics:
Im curious as to general methods to update multiple rows in a database.
Currently Im thinking of just allowing a user to update one row of data at a
time and designing/building textboxes to allow them to enter this data. I
would then use a method to insert this data. (sqlCommand)
Is there a more efficient method of updating 10 rows of data at a time? Such
|
by: Ed L. |
last post by:
I think I'm seeing table-level lock contention in the following function
when I have many different concurrent callers, each with mutually distinct
values for $1. Is there a way to reimplement this function using
select-for-update (or equivalent) in order to get a row-level lock (and
thus less contention) while maintaining the function interface? The docs
seem to suggest so, but it's not clear how to return the SETOF queued_item
and also...
|
by: Mark Harrison |
last post by:
So I have some data that I want to put into a table. If the
row already exists (as defined by the primary key), I would
like to update the row. Otherwise, I would like to insert
the row.
I've been doing something like
delete from foo where name = 'xx';
insert into foo values('xx',1,2,...);
|
by: spartacus |
last post by:
Hi,
Does SQL support update to multiple rows where values coming from a
sub-query?
e.g
insert into TABLE1
select column1, column2, column3 from TABLE2
|
by: MARIEDB2 |
last post by:
Hello,
I am struggling to build a query on a DB2 db wich does an update for multiple fields which are the result of a select query with where clause (using multiple tables in the condition).
E.g.
UPDATE TABLE_HDR
SET HDRFIELD1 = 'XX'
WHERE EXIST
(SELECT HDRFIELD1 FROM TABLE_HDR,TABLE_1A,TABLE_1B WHERE FIELD_1A= FIELD_1B AND HDRFIELD1=FIELD1A)
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |