lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

On Wed, Nov 30, 2005 at 02:25:33PM +0000, Robert Raschke wrote:
> I've come across a slight problem in dealing with problems when using
> LuaSQL.  I have a select statment that, for some reason I haven't yet
> managed to figure out, returns the error message below:
> > require "luasql.oci8"
> > dbenv = luasql.oci8()
> > dbcon = dbenv:connect("SERVICE", "USER", "PASSWORD")
> > dbcur = dbcon:execute(_select_statement_)
> stdin:1: LuaSQL: invalid type 12 #2
in rdbms/demo/ocidfn.h as of oracle 8.1
this is SQLT_DAT /* date in oracle format */

grep the headers of your installation for SQLT_

there are a couple of types not supported by the ls_oci8,
but in most situations you can avoid them by changing your
query like applying some to_char to your date.

> > dbcon:close()
> stdin:1: LuaSQL: there are open cursors
you are lucky if you do not have to restart oracle :)
No, honestly it's in ls_oci8.c

> My gut instinct would be to have close() tear down the other stuff as
> well.  So, dbcon:close() would automatically close all open cursors,
> and dbenv:close() would close all open connections (which in turn
> closes all cursors).
at least create_cursor in ls_oci8.c should probably catch
a failed alloc_column_buffer and discard the cursor right away.

ls_postgres.c should not exhibit these problems,
as the pg interface is much, much less of a pita.