> db.define_table('headers',...)
>
> db.define_table('details',
>   SQLFIELD('header_id', 'header')
> )

should be

db.define_table('headers',...)

db.define_table('details',
   SQLFIELD('header_id', db.header)
 )

On Mar 27, 1:10 am, SergeyPo <ser...@zarealye.com> wrote:
> Don't hesitate to send me patches for testing in Oracle.
> There are more problems when running on Oracle, but they can be
> eliminated:
>
> 1. Famous Oracle error 'identifier is too long' - usually happens in
> models like
>
> db.define_table('headers',...)
>
> db.define_table('details',
>   SQLFIELD('header_id', 'header')
> )
>
> Web2py builds constraint for key field and it is named something like
> 'detais_header_id__constraint' - and this often exceeds 31 chars limit
> allowed by Oracle for all identifiers. I suggest to make suffix
> shorter, e.g. '_c' or just '_' otherwise I  have to globally rename
> readable identifiers to something like 'a_b' in all of my code.
>
> 2. Maybe my design fault, but anyway: open source databases usually
> truncate strings if you write 'longtextmanychars' to VARCHAR(8). Grown
> up guys like Oracle don't allow this and give error. I tried to write
> a fix-up function like
>
> def truncate_string(sql_field, string):
>     if sql_field.type=='string': return string[:sql_field.length]
>     else: return string
>
> but this completely breaks for international texts. Adding unicode
> (string, 'utf-8') and so on similar to your code in SQLTABLE truncate
> does not help - Oracle VARCHAR2(255) does not let my strings in.
>
> Thank you!
> Sergey
>
> On Mar 27, 8:29 am, mdipierro <mdipie...@cs.depaul.edu> wrote:
>
> > Thank you. Will look into these asap.
>
> > Massimo
>
> > On Mar 26, 9:46 am, SergeyPo <ser...@zarealye.com> wrote:
>
> > > Hi all,
>
> > > these probolems may be caused by unicode support by Oracle DB (or not
> > > - I don't know). The code works fine with MySQL and SQLite.
>
> > > 1. DAL migrations do not work if you change length of 'string' field.
> > > E.g. I have this:
> > > SQLField('komment', 'string', length=255)
> > > and I try to change it to
> > > SQLField('komment', 'string', length=512)
> > > and I get ORA-00911 error (bad symbol!)
>
> > > 2. When I try to migrate this field to SQLField('komment', 'text') I
> > > get same error: ORA-00911
>
> > > 3. I managed to migrate by removing this field definition, running the
> > > model (reload db admin page in browser) and pasting back the field
> > > definition SQLField('komment', 'text')
> > > Everything looked ok.
> > > Then I run data import script that inserts data from UTF-8 encoded
> > > file into this field. Script worked without problems.
> > > Then I try to see data in db admin page and get this error (the same
> > > error I get from any scripts that try to read data from this field):
>
> > > Traceback (most recent call last):
> > >   File "c:\web2py\gluon\restricted.py", line 98, in restricted
> > >     exec ccode in environment
> > >   File "c:/web2py/applications/advantage/controllers/appadmin.py",
> > > line 196, in <module>
> > >   File "c:\web2py\gluon\globals.py", line 75, in <lambda>
> > >     self._caller = lambda f: f()
> > >   File "c:/web2py/applications/advantage/controllers/appadmin.py",
> > > line 160, in select
> > >     records=SQLTABLE
> > > (records,linkto,upload,orderby=True,_class='sortable'))
> > >   File "c:\web2py\gluon\sqlhtml.py", line 634, in __init__
> > >     r = str(field.formatter(r))
> > > ProgrammingError: LOB variable no longer valid after subsequent fetch
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to