mysql - How come I know that my execute statement is working fine? -


i'm novice groovy , have doubt. let's i'm doing :

db.execute ''' //my sql commands ''' 

programmatically how can find execute method succeeds?

i tried way :

def status = db.execute ''' //my sql commands ''' 

but though data have been inserted db ( have viewed in mysql client ), status returns false. confusing me. whats going on?

i'm assuming you're using groovy.sql.sql object. if @ api (linked previously) execute() method, says return false either row count return value or no results return value.

since mentioned insert statement, check row count via:

if (db.updatecount() > 0) { /* success! */ } 

Comments

Popular posts from this blog

javascript - backbone.js Collection.add() doesn't `construct` (`initialize`) an object -

php - Get uncommon values from two or more arrays -

Adding duplicate array rows in Php -