Afficher un message
Vieux 21/06/2008, 11h18   #3
Leslie Viljoen
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: sqlite3-ruby problem accessing row values

On 6/20/08, The Doobs <thedoobs@gmail.com> wrote:
> I get a "can't convert String into Integer (TypeError)" error about the
> print statement in the following code. The sqlite3-ruby library has been
> installed successfully on my OS X 10.5 system. The code executes fine if
> I replace the print statement with: print "hello". Any suggestions? All
> I want to do is iterate through each row in the return set (rows) of the
> executed query and look at specific column values. I have run out of
> ideas on how to fix this and would appreciate any . Thanks...
>
> #!/usr/bin/ruby
>
> require "sqlite3"
>
> query = "select * from moz_bookmarks"
> db = SQLite3:atabase.new("/Users/me/Desktop/places.sqlite")
> rows = db.execute(query)
> rows.each do |row|
> print row['title']
> end


Perhaps it would if you uploaded places.sqlite somewhere (like
Mediafire) so we can try the program. Otherwise, even the schema would


Les

  Réponse avec citation
 
Page generated in 0,04634 seconds with 9 queries