Save and retrieve data from DBM : dbm « Database « Ruby






Save and retrieve data from DBM


require 'dbm'

d = DBM.new("data")
d["123"] = "123"
puts d["123"]  
d.close

puts d["123"]             # RuntimeError: closed DBM file

e = DBM.open("data")
e["123"]       
w=e.to_hash    
e.close

e["123"]                  # RuntimeError: closed DBM file
w["123"]       

 








Related examples in the same category

1.Using Berkeley DB Databases
2.Save and retrieve data from Berkeley DB Databases
3.each loop on Berkeley DB Databases