From: Steve Cranford Date: 2002-04-19T00:27:07+09:00 Subject: ruby/postgres problem I'm trying to determine if a resultset is empty. if it is, I want to perform other actions. I tried this code and it didn't work: result=conn.exec(sql) msg="testing" if result.num_tuples==0 # run an insert msg="new action" end msg<< result.num_tuples.to_s #or a variation, I see the number. the number of tuples correctly reports on the screen but the if block never executes. I've had similar problems with numeric values in a case statement. I've tried using variables in place of the values in the if statement as well as a (!result), but nothing seems to work. what am I doing wrong? Steve Cranford ------------------------------------------------------------------- ------------- www.Stevechome.com Steve@SteveChome.com Phone: (478) 405-0653 Simple Solutions to Complex Confusions