lua-users home
lua-l archive

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


Hi!
Hopefully this is a simple question. I am very new to lua but it is very cool. I need to be able to query Oracle databases. I am trying to use luasql 2.0.2 with lua 5.1.2 (most current versions if i have typed the numbers wrong) on Windows XP PRO SP2. All components came from luaforge.
 
Here is the error message:
 
'c:\temp.d\dmv.d\lua.d\bin\luasql\oci8.dll':
c:\temp.d\dmv.d\lua.d\bin\luasql\oci8.dll:1: '=' expected near 'É'
stack traceback:
[C]: ?
[C]: in function 'require'
       test.lua:5: in main chunk
[C]: ?
 

Here is my code, copied from the luasql examples and modified
for what I am trying to do:
 
-- load driver
package.path = "c:\\temp.d\\dmv.d\\lua.d\\bin\\?.dll"
package.cpath = "c:\\temp.d\\dmv.d\\lua.d\\bin\\?.dll"
require "luasql.oci8"
-- create environment
objectenv = assert (luasql.oci8())
-- connect to data source
con = assert (env:connect("<server>", "<user>", "<password>"))
cur = assert (con:execute"SELECT * from dual")
-- print all rows, the rows will be indexed by field names
row = cur:fetch ({}, "a")
while row
  do  print(string.format("%s", row))
  -- reusing the table of results
  row = cur:fetch (row, "a")
end
-- close everything
cur:close()
con:close()
env:close()
 
Any help, hints, etc. is greatfully appreciated. Please let me know if you need more info.
 
Thanks for your time and patience!
 
Dave Venus