On Wednesday, September 2, 2020 at 7:39:15 AM UTC-7, J. Lewis Muir wrote:
>
> On Wednesday, September 2, 2020 at 9:04:47 AM UTC-5 Jeremy Evans wrote:
>
>> I'm not sure, but I'm guessing no, and using Dataset#fetch is your best
>> bet if the stored procedure returns a result set.
>>
>
> Thanks. I tried using DB.run:
>
> DB.run("SET @person_id = NULL; CALL upsert_person(@person_id, ...);")
>
> but I get an exception:
>
> ~/.gem/ruby/gems/mysql2-0.5.3/lib/mysql2/client.rb:131:in `_query':
> Mysql2::Error: You have an error in your SQL syntax; check the manual that
> corresponds to your MariaDB server version for the right syntax to use near
> 'CALL upsert_person(@person_id, 20, NULL, NULL, NULL, NULL, NULL, 'OSC',
> '2020-0...' at line 1 (Sequel::DatabaseError)
>
>
> Any ideas why that is rejected? I confirmed that the SQL is valid and
> executes correctly with the mysql CLI client.
>
I'm not sure whether the driver supports multiple SQL statements in a
single call. Using multiple SQL statements in a single call is undefined
behavior in Sequel, and whether it works depends on the driver.
Thanks,
Jeremy
--
You received this message because you are subscribed to the Google Groups
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/sequel-talk/0d73838c-e618-4193-af2b-e8ad128715deo%40googlegroups.com.