cancel
Showing results for 
Search instead for 
Did you mean: 

Groovy Question sql.execute

Highlighted
Super Contributor

Groovy Question sql.execute

Hello,
I have a groovy statement

boolean status = sql.execute("UPDATE dbo.aspnet_Membership set IsApproved = 1 where LoweredEmail=${Email}");

I check the database and verify that the update actually happened. However, regardless of the outcome the sql.execute() always seems to return 'false'. Do you if I am doing any thing wrong.

I want to throw an exception if it returns false and dont throw any exception if it returns true.  but at the moment I cant figure out how to throw true.

Thanks

Ali
1 REPLY 1
Super Contributor

Re: Groovy Question sql.execute

Hi Ali,

sql.execute returns a boolean indicating if the result is a resultSet.. in your case always false.. If something goes wrong, the execute call itself will throw an exception..

Hope this helps!

regards,

/Ole
eviware.com
New Here?
Join us and watch the welcome video:
Top Kudoed Authors