Ruby/Database/Oracle
Материал из Wiki.crossplatform.ru
queries the table "EMP":
require "dbi" URL = "dbi:Oracle:oracle.neumann" dbh = DBI.connect(URL, "scott", "tiger") rows = dbh.select_all("SELECT * FROM EMP") p rows dbh.disconnect
Without closing the connection
require "dbi" URL = "dbi:Oracle:oracle.neumann" DBI.connect(URL, "scott", "tiger") do | dbh | p dbh.select_all("SELECT * FROM EMP") end