• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • Use SQL to Easily Update Multi-Key Files

    July 27, 2005 Hey, Ted

    Updating a single record in a file that has a lot of key fields often requires SQL commands with complicated WHERE clauses. I use a technique with web applications that greatly simplifies the WHERE clause. I have never seen this technique published before, so I hope you can use it.

    When I retrieve a record that will be updated through a Web browser, I select the relative record number along with the data.

    SELECT RRN(MyFile) as storedRRN, MyFile.* 
      FROM MyFile 
     WHERE ENBBTYPE = 'COPY' and ENBBTCH# = 4062
    

    When I update, I need only refer to the relative record number.

    UPDATE MyFile 
       SET SomeCode = 'FRO', Description = 'Front' 
     WHERE RRN(MyFile) = storedRRN
    

    –Chuck Wakelee, Cardone Industries

    Since I favor making things as simple as possible, I am glad to publish Chuck’s tip. It may not be worth my mentioning it, but Chuck’s SQL statements are bare-bones illustrations. To use this technique in a program will require the use of host variables.

    –Ted


    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Tags:

    Sponsored by
    ARCAD Software

    Embrace VS Code for IBM i Development

    The IBM i development landscape is evolving with modern tools that enhance efficiency and collaboration. Ready to make the move to VS Code for IBM i?

    Join us for this webinar where we’ll showcase how VS Code can serve as a powerful editor for native IBM i code and explore the essential extensions that make it possible.

    In this session, you’ll discover:

    • How ARCAD’s integration with VS Code provides deep metadata insights, allowing developers to assess the impact of their changes upfront.
    • The role of Git in enabling seamless collaboration between developers using tools like SEU, RDi, and VS Code.
    • Powerful extensions for code quality, security, impact analysis, smart build, and automated RPG conversion to Free Form.
    • How non-IBM i developers can now contribute to IBM i projects without prior knowledge of its specifics, while ensuring full control over their changes.

    The future of IBM i development is here. Let ARCAD be your guide!

    Watch Now

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Cozzi Updates RPG xTools, Partners with Linoma DRV Technologies Gets Hip to Forms

    Leave a Reply Cancel reply

Volume 5, Number 29 -- July 27, 2005
THIS ISSUE
SPONSORED BY:

ProData Computer Svcs
Advanced Systems Concepts
Patrick Townsend & Associates

Table of Contents

  • Of Middle-Tested Loops
  • Use SQL to Easily Update Multi-Key Files
  • Admin Alert: To Each Its Own in Spooled File Management

Content archive

  • The Four Hundred
  • Four Hundred Stuff
  • Four Hundred Guru

Recent Posts

  • Liam Allan Shares What’s Coming Next With Code For IBM i
  • From Stable To Scalable: Visual LANSA 16 Powers IBM i Growth – Launching July 8
  • VS Code Will Be The Heart Of The Modern IBM i Platform
  • The AS/400: A 37-Year-Old Dog That Loves To Learn New Tricks
  • IBM i PTF Guide, Volume 27, Number 25
  • Meet The Next Gen Of IBMers Helping To Build IBM i
  • Looks Like IBM Is Building A Linux-Like PASE For IBM i After All
  • Will Independent IBM i Clouds Survive PowerVS?
  • Now, IBM Is Jacking Up Hardware Maintenance Prices
  • IBM i PTF Guide, Volume 27, Number 24

Subscribe

To get news from IT Jungle sent to your inbox every week, subscribe to our newsletter.

Pages

  • About Us
  • Contact
  • Contributors
  • Four Hundred Monitor
  • IBM i PTF Guide
  • Media Kit
  • Subscribe

Search

Copyright © 2025 IT Jungle