lunarmodules / luasql

LuaSQL is a simple interface from Lua to a DBMS.
http://lunarmodules.github.io/luasql
539 stars 191 forks source link

LuaSQL: unknown type #31

Open yakantosat opened 9 years ago

yakantosat commented 9 years ago

I used the luasql.oci8 driver to connect the Oracle database. My code is as follow: db_oci8.lua:

local driver = require "luasql.oci8" local env = driver.oci8() local con = env:connect("myserviceName", "username", "password") local cur = con.execute "select * from test" nums = cur:numrows()

cur:close() con:close() env:close()

When I run my code. (luajit db_oci8.lua). There are something wrong on my code, the error message is as follow: luajit: LuaSQL: unknown type.

Why occour to this issue?

tomasguisasola commented 9 years ago

Hi

The driver cannot deal with all Oracle's data types. Your table should have one of those... Could you send more information about your table?

Regards, Tomás

On 2015-04-22 06:09, SAT wrote:

I used the luasql.oci8 driver to connect the Oracle database. My code is as follow: db_oci8.lua:

local driver = require "luasql.oci8" local env = driver.oci8() local con = env:connect("myserviceName", "username", "password") local cur = con.execute "select * from test" nums = cur:numrows()

cur:close() con:close() env:close()

When I run my code. (luajit db_oci8.lua). There are something wrong on my code, the error message is as follow: luajit: LuaSQL: unknown type.

Why occour to this issue?

Reply to this email directly or view it on GitHub.

yakantosat commented 9 years ago

There are fourteen fields in my table. The correspondence of Name and Type are as follow: OBJECT_NAME VARCHAR2(128) SUBOBJECT_NAME VARCHAR2(30) OBJECT_ID NUMBER DATA_OBJECT_ID NUMBER OBJECT_TYPE VARCHAR2(19) CREATED DATE LAST_DDL_TIME DATE TIMESTAMP VARCHAR2(19) STATUS VARCHAR2(7) TEMPORARY VARCHAR2(1) GENRATED VARCHAR2(1) SECONDARY VARCHAR2(1) NAMESPACE NUMBER EDITION_NAME VARCHAR2(30)

When I want to select the CREATED field, it will make a mistake. Can the type of DATE be selected by Oci8 Driver?

Thanks a lot!!

tomasguisasola commented 9 years ago

Hi SAT

Yes, the current OCI driver does not manage DATE type. There is a patch on the way and I hope a new maintainer. Would you mind waiting a few days?

Regards, Tomás

On 2015-04-22 22:54, SAT wrote:

There are fourteen fields in my table. The correspondence of Name and Type are as follow: OBJECT_NAME VARCHAR2(128) SUBOBJECT_NAME VARCHAR2(30) OBJECT_ID NUMBER DATA_OBJECT_ID NUMBER OBJECT_TYPE VARCHAR2(19) CREATED DATE LAST_DDL_TIME DATE TIMESTAMP VARCHAR2(19) STATUS VARCHAR2(7) TEMPORARY VARCHAR2(1) GENRATED VARCHAR2(1) SECONDARY VARCHAR2(1) NAMESPACE NUMBER EDITION_NAME VARCHAR2(30)

When I want to select the CREATED field, it will make a mistake. Can the type of DATE be selected by Oci8 Driver?

Thanks a lot!!

Reply to this email directly or view it on GitHub [1].

*

Links:

[1] https://github.com/keplerproject/luasql/issues/31#issuecomment-95387442

yakantosat commented 9 years ago

Thank you very much! I am looking forward to it.