mwild1 / luadbi

Multi-backend SQL database library for Lua
MIT License
42 stars 15 forks source link

How execute prepared query multiple times. #34

Closed moteus closed 8 years ago

moteus commented 8 years ago

I can not find describe in doc or test either this should works

sth = dbh:prepare("insert into my_table(?)")
sth:execute(1)
sth:execute(2)
sparked435 commented 8 years ago

This should "just work", exactly as shown above.

I have just committed a new test to prove it.

moteus commented 8 years ago

but if query return recordset how to close it without fetch all. in my odbc i close cursor in execute if it open Rhis is just my note. If it not suppose to work i am fine with it

mwild1 commented 8 years ago

Most database interfaces require you to fetch all the results before executing a new query, so it is best to do that.