Home > Ask the AS/400 Experts > DB2/400 and DB2 UDB Questions & Answers > SQL Updates with functions
Ask The iSeries 400 Expert: Questions & Answers
EMAIL THIS

SQL Updates with functions

Kent Milligan EXPERT RESPONSE FROM: Kent Milligan

Pose a Question
Other iSeries 400 Categories
Meet all iSeries 400 Experts
Become an Expert for this site


iSeries news and advice
Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google


>
QUESTION POSED ON: 17 April 2008
I searched the entire TargetSearch but still couldn't find the SQL UPDATE with the addition function. May I know how to perform an SQL UPDATE with the following condition? EX: File1 with FieldA and File2 with FieldB...how to do the SQL UPDATE for FieldA in the equation below: FieldA=FieldA+FieldB?

>
EXPERT RESPONSE
The UPDATE would look be similar to the following statements depending on search conditions (if any)

UPDATE file1 SET FieldA=FieldA + (SELECT FieldB FROM file2)

UPDATE file1 SET FieldA=FieldA + (SELECT FieldB FROM file2 WHERE file2.keyfld = file1.keyfld)


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google


RELATED CONTENT
DB2/400 and DB2 UDB
Running source member SQL statements with RUNSQLSTM
Enabling IBM i to access Microsoft SQL server data
Using SQL to search within a DB2 field on IBM i
Controlling a library list on a remote system
Auditing: RPG with embedded SQL showing up as a changed object
Selecting a PF with multiple members from SQL
Referencing a renamed column on SELECT clause in SQL
Using WebSphere information integrator to access MS server data using SQLRPGLE
Joining files using SQLRPGLE
Querying system catalog tables to determine table alias

iSeries SQL commands and statements
Running source member SQL statements with RUNSQLSTM
Enabling IBM i to access Microsoft SQL server data
Using SQL to search within a DB2 field on IBM i
Controlling a library list on a remote system
Selecting a PF with multiple members from SQL
Referencing a renamed column on SELECT clause in SQL
How to use an embedded SQL statement and display the result in a subfile
Blocking access to SQL line commands
Joining files using SQLRPGLE
Querying system catalog tables to determine table alias
iSeries SQL commands and statements Research

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary



Search and Browse the Expert Answer Center
Search and browse more than 25,000 question and answer pairs from more than 250 TechTarget industry experts.
Browse our Expert Advice



iSeries Networking - Printing, Remote Access, TCP/IP
HomeNewsTopicsITKnowledge ExchangeTipsBlogsAsk the ExpertsMultimediaWhite PapersProducts
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides enterprise IT professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective IT purchase decisions and managing their organizations' IT projects - with its network of technology-specific Web sites, events and magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Reprints  |  Site Map




All Rights Reserved, Copyright 1999 - 2008, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts