Thanx for the next explanation of your problem. Now it´s much clearer.
After seeing and understanding your problem my only thought is:
Your database-design needs a restructure...
You need two tables:
items
- id (unique, autoincrement)
- name (if you want)
INSERT INTO items SET id=1, name = "Event X"
itemdetails
- detailid (unique, autoincrement)
- itemid
- value
Your item itself have one "short" database-entry in items
The names you store in a second table itemdetails
For your example
header1 = Bob
header2 = Smith
header3 = <blank, not used>
header4 = Jack
INSERT INTO itemdetails SET itemid=1, value="Bob"
INSERT INTO itemdetails SET itemid=1, value="Smith"
INSERT INTO itemdetails SET itemid=1, value="Jack"
[..] You can put more than 256 names here with this structure. And even if you just need 4 you dont need one item with 257 fields and 252 emty of them (but they need space in DB even if empty)
To get a names list from one item you need something like
select * from itemdetails
left join items on itemid=id
where id=1
order by Value ASC
With such a sql-query you´ll get (in case if itemid=1) three results
I´m not familar with sqlite but this should work in sqlite in a way like this .