Using SQLite

B

basi

Any pointers to articles on sample Ruby code using SQLite3 -- the usual
database DML and DDL stuff: creating and managing dbs and tables, and
inserting, updating, deleting records. Thanks.
gk
 
B

basi

Hello,

In the following, as soon as I hit Return (on the 003 line), the fxri
screen disappears. "Products" is a table in the database. Did I enter
the command properly? When I enter the select command in SQLiteSpy, it
works. Thanks.
gk

irb(main):001:0> require 'sqlite3'
=> false
irb(main):002:0> db =
SQLite3::Database.new("c:\work\depot\db\depot_development.db3")
=> #<SQLite3::Database:0x4037078
@driver=#<SQLite3::Driver::Native::Driver:0x4025f78 @callback_data={}>,
@statement_factory=SQLite3::Statement, @type_translation=false,
@handle=#<SWIG::TYPE_p_sqlite3:0x4025ed0>, @results_as_hash=false,
@closed=false, @translator=nil>
irb(main):003:0> count = db.get_first_value( "select count(*) from
products")
 
B

Bob Hutchison

I missed it too.

... because it is in the usage section of the ruby doc and I wasn't
ready, I thought, to look at those... What else is there in there?
Tutorial? Examples? (not that the FAQ isn't a huge help and much
appreciated, but, you know, I guess I'm greedy :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,181
Messages
2,570,970
Members
47,537
Latest member
BellCorone

Latest Threads

Top