![]() ![]() CURRENT OF is also permitted on the DELETE command. Second, I’ve included the CURRENT OF phrase in the UPDATE command. If you want to update more than one field, list the fields and separate them with commas. First, the field to be changed has been listed in the cursor declaration. This program could be replaced with one searched UPDATE command, but I want an easily understood example, so here’s the equivalent using a positioned update.Ĭ+ set option commit=*none,closqlcsr=*endmod First let’s look at a program that uses traditional I/O methods to grant 4 percent salary increases to employees with an ATYPE code of W. Here’s a simple illustration using the RPG language. Searched updates give you a lot of bang for the buck, but positioned updates are needed when the update logic is complex. The set-at-a-time update to which you referred is called a searched update. IBM calls this type of update a positioned update. The words CURRENT OF, followed by the cursor name, refer to the last row that was retrieved through the cursor with the FETCH command. SQL provides a special phrase, CURRENT OF, which you place in the WHERE clause.
0 Comments
Leave a Reply. |