I cannot reproduce the problem. I tried this
db=DAL('sqlite://storage.db')
db.define_table('fields',
Field('aaa'),
Field('value', 'text'))
db.fields.insert(aaa='aaa',value='aaa')
db.fields.insert(aaa='aaa',value=None)
db.fields.insert(aaa='aaa',value='')
db.commit()
for row in db(db.fields.id>0).select():
print row.aaa, row.value
And I get:
aaa aaa
aaa None
aaa
Please run this test:
print len(dx.executesql('SELECT * from fields'))
what do you get?
If you get 29000 that it is not a web2py problem but a problem with
the sqlite adaptor.
If you get 43000, can you email me the data file? I will keep it
confidential.
Massimo
On Mar 25, 3:50 pm, Peter Etchells <[email protected]> wrote:
> I am getting a conflict between the number of records in a migrated
> table shown by web2py vs two other applications, including sqlite
> database browser
>
> I am trying to access a sqlite db created by another application
> (anki). One table is fields:
>
> dx.define_table('fields',
> Field('ordinal', 'integer'),
> Field('fieldModelId', 'integer'),
> Field('value', 'text'),
> Field('factId', 'integer'),
> migrate=False)
>
> when viewing the db through SQLite Database Browser, I see 43k rows.
> This app's export to csv tool also correctly exports 43k rows.
> the original app, anki, also shows the data correctly.
>
> web2py appadmin shows 29k rows. The difference is the 13k rows which
> have no value for the field 'value', even though all the other fields
> are populated.
>
> I can create a new table:
> db.define_table('fields',
> Field('ordinal', 'integer'),
> Field('fieldModelId', 'integer'),
> Field('value', 'text', ),
> Field('factId', 'integer'),
> )
>
> and import the csv file mentioned above, and get 43k rows ok.
>
> The problem is obviously how the empty 'value' fields are being
> handled by web2py, even though other fields in the same row contain
> data.
>
> This data is seen both by sqlite browser and web2py:
> "id","factId","fieldModelId","ordinal","value"
> "-9222185497037268093","-4316747355063482654","-6321913516499105683","1","[sound:fra-
> cbb13801.ogg]"
> "-9221937007409386061","7260819814348064482","-8843535682663839635","0","haleine"
> "-9220780321176965740","-5738154206010439966","-8843535682663839635","0","l'argument"
> "-9220063439595660382","1174770066933516017","-6321913516499105683","1","[sound:fra-56b2f359.ogg]"
> "-9219900711874744956","-5069433433020332334","-8843535682663839635","0","vite"
> "-9219691804665467469","-5624836338628589854","-8843535682663839635","0","un
> gland"
> "-9219405931642245662","8916442433220609777","-8843535682663839635","0","poster"
>
> This data is seen by sqlite browser but not web2py:
> "9222867527788765756","-7051468068830738703","1357763988909412593","2",""
> "9222867527788765757","-7050179441202985231","1357763988909412593","2",""
> "9222867527788765758","-7049552719575152942","1357763988909412593","2",""
> "9222867527788765759","-7048061781807888670","1357763988909412593","2",""
> "9222867527788765760","-7047019444784757007","1357763988909412593","2",""
> "9222867527788765761","-7046907294598723839","1357763988909412593","2",""
> "9222867527788765762","-7043602162645629230","1357763988909412593","2",""
> "9222867527788765763","-7039553760832157951","1357763988909412593","2",""
>
> Any ideas, please?
--
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en.