require 'oci8'

session = OCI8.new('user', 'password')
query = "SELECT TO_CHAR(SYSDATE, 'YYYY/MM/DD') FROM DUAL"
cursor = session.exec(query)
result = cursor.fetch         # Only one iteration in this case
cursor.close
session.logoff

