MySQL Forums
Forum List  »  Stored Procedures

Re: Passing value beteen declared variables within cursor loop
Posted by: Michael Ayres
Date: March 15, 2016 08:17PM

Some query statements might work, but somehow i have to capture a field value and insert it into any following (one or more) records with a null in same field. Then, when I encounter a record with a value already in the field, I need to capture it and insert into any following empty records.

The data looks like this

field1 id
foo1 21
foo2 --
foo3 --
foo4 --
foo5 33
foo6 --
foo7 --
....
so I need to update foo2, foo3, foo4 to 21, and then update foo6, foo7 to 33

etc through the table

Michael Ayres
Senior Technical Project Manager
Cyber Security Coordination Center

Michael Ayres, MS, PMP, ACP, CISSP
University of California Office of the President (contractor)
1111 Franklin Street #7109 Oakland, Ca.94607
Michael.Ayres@ucop.edu | (510) 987-9459 | (415) 999-2049 Mobile

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.