def _process_insert_query(self, query, tablename, seqname):
#@@ is this the correct way to find the sequence name?
if seqname is None:
seqname = tablename + "_id_seq"
return query + "; SELECT %s.currval FROM dual" % seqname
With respect to the above method in db.py I don't think there is a way
to get a tables sequence name in Oracle from the table name as tables
and sequences are independent objects. Anyway that appears to the case
looking at Oracle data dictionary. So it would appear you need to pass
the sequence name explicitly.
kromakey
On 3 Jul, 19:49, kromakey <[EMAIL PROTECTED]> wrote:
> connect works.
> db.select works.
>
> db.insert fails with:
>
> 127.0.0.1:50428 - - [03/Jul/2008 19:45:58] "HTTP/1.1 GET /" - 500
> Internal Server Error
> Traceback (most recent call last):
> File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
> python2.5/site-packages/web/application.py", line 205, in wsgi
> result = self.handle_with_processors()
> File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
> python2.5/site-packages/web/application.py", line 177, in
> handle_with_processors
> return process(self.processors)
> File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
> python2.5/site-packages/web/application.py", line 174, in process
> return self.handle()
> File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
> python2.5/site-packages/web/application.py", line 166, in handle
> return self._delegate(fn, self.fvars, args)
> File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
> python2.5/site-packages/web/application.py", line 342, in _delegate
> return handle_class(cls)
> File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
> python2.5/site-packages/web/application.py", line 317, in handle_class
> return tocall(*args)
> File "wp3.py", line 10, in GET
> db.insert('test', name='Bob')
> File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
> python2.5/site-packages/web/db.py", line 685, in insert
> self._db_execute(db_cursor, sql_query)
> File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
> python2.5/site-packages/web/db.py", line 511, in _db_execute
> for x in sql_query.values()])
> DatabaseError: ORA-01036: illegal variable name/number
>
> Cheers
> kromakey
>
> On 3 Jul, 06:17, "Anand Chitipothu" <[EMAIL PROTECTED]> wrote:
>
> > Filed a bug.
>
> >https://bugs.launchpad.net/bugs/245087
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web.py" 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/webpy?hl=en
-~----------~----~----~----~------~----~------~--~---