Dileep Nunna
Dileep Nunna

Reputation: 109

How to get column value with insert query using sequel?

How to fetch column value at the time of inserting into MySQL DB using sequel. Tried below query getting type error: no implicit conversion to integer.

DB[:table].import([:x, :y], [[1, 2]], [:return=>:primary_key]).

Upvotes: 0

Views: 145

Answers (1)

David K-J
David K-J

Reputation: 928

As per the docs, you should be passing opts in without the square brackets, like so:

DB[:table].import([:x, :y], [[1, 2]], :return =>: primary_key)

Upvotes: 2

Related Questions