I have to update a field in certain records based on a user's input. I've been fishing around a bit and I think I have a bead on it. I would like some confirmation though...
I think it will look something like this....
Is it really that simple? or am I missing something in my update??
P.S. This is SQL embedded in RPGLE
I think it will look something like this....
PHP Code:
/EXEC SQL
+ DECLARE C1 CURSOR FOR SELECT [I]fields go here[/I]
+ FROM
+ WHERE
+ FOR UPDATE
/END-SQL
/EXEC SQL
+ OPEN C1
/END-SQL
/EXEC FETCH
+ [I]FETCH STUFF GOES HERE[/I]
/END-SQL
[I]DO SOME PROCESSING ON THE INFORMATION[/I]
[B]/EXEC SQL
+ UPDATE [TABLE-NAME]
+ SET [FIELD-NAME] = :[VAR-NAME]
/END-SQL [/B]
P.S. This is SQL embedded in RPGLE




Comment