We're a community of 1.1M IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,080,680 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

how to compare records obtained from DB

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
1
Contributor
0
Replies
1
View
sum1
Newbie Poster
1 post since Feb 2009
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page generated in 0.0497 seconds using 2.56MB