An update:
This works and executes the procedure and "creates the customer"
out_param = 0
result =
@@db.dataset.call_sproc(:update,"SpInsertCustomer",out_param,"Test
Customer",99,18,2,"123456",nil)
puts out_param >> 0 (no change)
puts result >> nil (no return value)
Basically the issue is I am not getting back the value from the executed
procedure result:
Oracle definition:
PROCEDURE SpInsertCustomer(
*pCustomerID* *OUT* NUMBER,
pTitle VARCHAR2 ,
pProduct IN NUMBER ,
pType NUMBER ,
pStatus NUMBER ,
pCustomerNo VARCHAR2 ,
pPassword VARCHAR2 DEFAULT NULL)
On Wednesday, October 27, 2021 at 2:24:13 PM UTC+2 Dylan Camilleri wrote:
> Hi :)
>
> This is my first question in the forum. I would like to know the proper
> way to execute an oracle stored procedure with Sequel and get back the
> return parameter from the procedure result into some variable.
>
> These do not seem to work or even execute the procedure(no errors)
> @@db = Sequel.connect((@config['db_connection']).to_s)
>
> result = @@db.dataset.call_sproc(:SpInsertCustomer,:args =>
> [out_param,"Test Customer",99,18,2,"123456",nil])
>
> It could also be an issue that commit is not done(dont know how to force
> this in Sequel, however I do not wish to have auto_commit = true with the
> connection. Tried wrapping this in a transaction too. No luck
>
> Thanks,
>
> Dylan
>
--
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/3ab69bce-47b1-4b6a-b3f5-4ddcb07f0525n%40googlegroups.com.