Hi Derek and Anthony,
I am not sure what else could cause this. You are right about the modeling. 
I did change the fields correctly and even recreated the exact table on a 
localhost mysql db and it worked!! However when I make the connection to 
the remote database Web2py just hangs. Also what's even more confusing is 
that I am able to connect to other tables in the same database just not the 
ones I am interested in!! I am completely stuck. The only thing that the 
affected tables have in common is that they contain data that is 
continually archived (I believe it polls the data every 15 minutes) from a 
running application.

regards.

John

On Wednesday, February 19, 2014 7:27:25 PM UTC+1, Derek wrote:
>
> I doubt that the name of it is an issue.
> datetime is not in the reserved list. 
>
>
> http://web2py.com/examples/static/epydoc/web2py.gluon.reserved_sql_keywords-pysrc.html
>
> your modeling of the database could be better. Why are you saying that 
> datetime is an int, when it's actually a decimal?
>
> On Wednesday, February 19, 2014 3:16:56 AM UTC-7, John Philip wrote:
>>
>> Hi Anthony,
>> thanks very much for your reply. I am able to now create the models ok. 
>> However when selecting specific tables in the mysql database web2py seems 
>> to hang. What I don't understand is that web2py seems to hang for tables 
>> using a field name 'datetime' which is a 
>> decimal(13,0) UN PK. Could it be that web2py gets confused by the 
>> fieldname called datetime?
>>
>> example of table in mysql db :
>> Tablename: evth
>> Fieldname       Type
>> datetime          decimal(13,0) UN PK
>> eventid             varchar(5)
>> stream             smallint(5) UN
>> application       varchar(11)
>> workstation      varchar(11)
>> severity           enum('INFORMATION','WARNING','ERROR', 'FATAL')
>> type                enum('SYSTEM','SOFTWARE','MIB','LOG')
>> message         varchar(432) PK
>>
>> thanks again for your help!
>>
>> John  
>>
>>   
>>
>>
>> On Tuesday, February 18, 2014 5:23:38 PM UTC+1, Anthony wrote:
>>>
>>> The amount of data doesn't affect how long it takes the appadmin home 
>>> page to load, as no data are being pulled from the database at that point. 
>>> Even when you do select a specific table, it only loads the first 100 
>>> records, so again, nothing should hang.
>>>
>>> Note, defining the model of the table (as in your code below) doesn't 
>>> actually pull any of the data from the database -- it just tells web2py 
>>> about the structure of the database table so it knows how to make selects, 
>>> updates, inserts, etc.
>>>
>>> Anthony
>>>
>>> On Tuesday, February 18, 2014 11:15:06 AM UTC-5, John Philip wrote:
>>>>
>>>> Hi there,
>>>>
>>>> I am trying to access a mysql database table with a very large amount 
>>>> of data. 
>>>>
>>>> dbsql =  DAL('mysql://myusername:mypasswrd@host/dbname', migrate=False)
>>>>
>>>> dbsql.define_table('evth',
>>>>     Field('datetime', 'integer'),
>>>>     Field('eventid','text'),
>>>>     Field('stream','integer'),
>>>>     Field('application','text'),
>>>>     Field('workstation','text'),
>>>>     Field('severity','text'),
>>>>     Field('type','text'),
>>>>     Field('message','text'),
>>>>     primarykey=['datetime'])
>>>>
>>>> In theory this should work. However when I run the database 
>>>> administration button to create the models it seems to hang. I suspect 
>>>> because of the amount of data. Since I am only interested in the most 
>>>> recent data is there anyway of doing this without web2py having to model 
>>>> the entire table? 
>>>>
>>>> any help would be much appreciated.
>>>>
>>>> many thanks and regards,
>>>>
>>>> John
>>>>
>>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to