Re: Display all the records from table using cursor
No primary key, yikes. A table without a PK isn't a real table.
A candidate key is a column or set of them uniquely identifying all rows. "Candidate" means "candidate to be primary key".
The logic is inescapable. If there's no PK and no candidate key, updates cannot be guaranteed. Period.
You can waste as many hours as you like trying to square that circle, you will not succeed.
Your requirement suggests that if the tables do have a candidate key, it's so complex that it will slow updates to a crawl. Which is when auto_increment is essential. So why haven't these tables been given PKs, and in any case what stops you from adding auto_increment PKs for this job?
Let's see the result of Show Create Table for one of these tables, along with, say, five sample rows of data, so I can analyse the update requirement.
Subject
Views
Written By
Posted
4031
September 22, 2017 06:21PM
864
September 22, 2017 07:46PM
899
September 22, 2017 10:11PM
786
September 25, 2017 09:07AM
778
September 25, 2017 11:17AM
731
September 25, 2017 11:15AM
834
September 25, 2017 12:49PM
Re: Display all the records from table using cursor
729
September 25, 2017 01:18PM
643
September 25, 2017 01:36PM
636
September 25, 2017 02:00PM
644
September 25, 2017 03:51PM
742
September 25, 2017 06:24PM
667
September 26, 2017 01:34PM
695
September 26, 2017 01:56PM
609
September 26, 2017 02:22PM
732
September 26, 2017 03:35PM
671
September 27, 2017 10:28AM
756
September 27, 2017 11:39AM
715
September 26, 2017 12:43PM
700
September 26, 2017 01:27PM
657
September 26, 2017 01:44PM
755
September 25, 2017 01:46PM
782
September 25, 2017 12:56PM