Number of affected rows for UPDATE/DELETE

118 views
Skip to first unread message

Brian Huddleston

unread,
Apr 13, 2018, 8:54:28 PM4/13/18
to ScalikeJDBC Users Group
Possibly a stupid question, but is there anyway with Scalike to get the number of affected rows when doing an UPDATE or a DELETE?  I poked around the methods but I didn't see anything immediately obvious.

-Brian

Kazuhiro Sera

unread,
Apr 14, 2018, 2:50:19 AM4/14/18
to Brian Huddleston, ScalikeJDBC Users Group
Hi Brian,

You can get the number of affected rows as the return value from
SQL.update.apply().

https://static.javadoc.io/org.scalikejdbc/scalikejdbc-core_2.12/3.2.2/scalikejdbc/SQLUpdate.html#apply()(implicitsession:scalikejdbc.DBSession):Int

Best,
Kaz
> --
> You received this message because you are subscribed to the Google Groups
> "ScalikeJDBC Users Group" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to scalikejdbc-users...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Brian Huddleston

unread,
Apr 14, 2018, 4:09:55 AM4/14/18
to ScalikeJDBC Users Group
Thanks for the help Kaz.  Not exactly sure how I missed that.
Reply all
Reply to author
Forward
0 new messages