I have created empty view with following query:
CREATE VIEW `test` AS select * from `configurations` where 0;
Consider configurations
table have 100 records with primary key id
starting from 0
to 100
.
I would like to insert data in view with chunk of 10
within loop.
I could not get any solution for the same. Can anyone give a bit of hint.
Update:
Following steps I want to perform.
- Create empty view (I achieved this)
- I have base table with 100 records in it.
- Now, I want my view to represent any
10
records based onid
like [where id IN (1,5,8,3,6,67,34,23,45,99)
] - Again after some operations I would like more 10 records to be selected from base table. like [
where id IN (11,55,88,33,66,27,43,23,15,19)
]
Hope I am clear enough.
OK, I'll try again.
This is a misinterpreation of what a view does - a view should be used to inspect existing data from actual table(s) in a fixed manner such that a view could be used to show all configurations with ID value less than 25 etc.
What you have described sounds like all you need to do is issue selects to your main table with a different list of ID's to retrieve.
Is there any reason you aren't doing this:
?
EDIT:
Add a column to your configuration table as an "in view" indicator. Update your view to only display records where in_view = 1. Then simply update the configurations table and set those interesting records to in_view=1
Hope that helps?