sum1 0 Newbie Poster

Hi,

I have created a DB connection using OCI and got a record(type: varchar2), but I'm unable to compare it with a string (this is string is same as the one which I retrieved from DB).
Below given is a code

conn = OCI8.new('username', 'pwd', 'DBNAME');
cursor = conn.exec('select fieldname from tablename where id = :1', '1234');
while record = cursor.fetch()
puts record
end
if (str == record.to_s.strip)  #This keeps on failing.
  puts "this record verified"
end
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.