Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9231261
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T06:01:29+00:00 2026-06-18T06:01:29+00:00

I am performing an update on a file that contains over 20 billion records

  • 0

I am performing an update on a file that contains over 20 billion records through sql for as400.

   UPDATE "LIBRARY"/AR#RMTPRL9 
   SET SENTFLAG = ' ', DATESENT = '0001-01-01', TIMESENT = '00:00:00', XMITT# = 0, LOCATION = 'PACI175A', ARBATCH# = ' ‘ 
   WHERE LOCATION = 'PACI173A' AND ARBATCH# = 'PAR1981181'

How can I run this update for different values of arbatch# in a single query to save time?

eg: I would like to use the same update statement for ARBATCH# values PAR19811284, PAR18736765 etc.

REEDITS:

I have the following data:(Move these values to location EFG)

  LOCATION     ARBATCH#
  ABC          1234
  ABC          5468
  ABC          8765
  XYZ          6759
  XYZ          5432

Here i would like to achieve a query which would perform update for records as follows:

 UPDATE "LIBRARY"/AR#RMTPRL9 
   SET SENTFLAG = ' ', DATESENT = '0001-01-01', TIMESENT = '00:00:00', XMITT# = 0, LOCATION = 'EFG', ARBATCH# = ' ‘ 
   WHERE LOCATION = 'ABC' AND ARBATCH# = '1234'

Now how could i successfully use “in” for such an update

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T06:01:30+00:00Added an answer on June 18, 2026 at 6:01 am

    You can ‘cheat’ pretty trivially:

    UPDATE "LIBRARY"/AR#RMTPRL9 
    SET SENTFLAG = ' ', 
        DATESENT = '0001-01-01', TIMESENT = '00:00:00', 
        XMITT# = 0, 
        LOCATION = 'EFG', 
        ARBATCH# = ' ' 
    WHERE (LOCATION, ARBATCH#) IN (VALUES ('ABC', '1234'),
                                          ('ABC', '5468'),
                                          ('ABC', '8765'),
                                          ('XYZ', '6759'),
                                          ('XYZ', '5432'))
    

    (Statement run on my local iSeries DB2 instance)

    Incidently, DATESENT and TIMESENT should be combined into a single timestamp, and probably be nullable, too. I’d personally prefer something like sentAt for the name, not something including the type of the column.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm performing a while loop in C#, this is going through some records being
In my current application, i am performing an update by invoking T-SQL Update command.
Do I need to close my file editor when performing update commands via Tortoise
I'm using a Webphere server. I am performing a file upload through a servlet
I have a WCF service that is performing some updates across a couple of
Im talking about performing a deep recursion for around 5+ mins, something that you
I'm currently experiencing a strange issue that my understanding of SQL server doesn't quite
My general question is, say you have a SQL Server 2005 database that's 20G
In my application, I am performing my file reading by another thread(other than the
I often have to check a table column before performing an update, insert, or

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.