0

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]).
3
  • 1
    Try without the square brackets? Like 1, 2]], :return => :primary_key) Commented Apr 13, 2016 at 12:39
  • Above one working. Commented Apr 13, 2016 at 12:42
  • Great! I have added as an answer Commented Apr 13, 2016 at 12:44

1 Answer 1

2

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)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.