I am looking for a way to use call stored procedure, there was no found. Is it possible in an elixir's ecto lib?
Create a simple stored procedure. DELIMITER ; To create the MySQL Stored Procedure, open the MySQL workbench Connect to the MySQL Database copy-paste the code in the query editor window click on Execute. You can view the procedure under stored procedures.
No, you cannot. Views are typically read-only operations; and that behavior cannot be guaranteed if stored-procedures are invoked. Related question: How to call Stored Procedure in a View?
You can go directly through the SQL adapter API:
Ecto.Adapters.SQL.query(YourRepo, "stored_procedure(?, ?)", [param1, param2])
More info here: https://hexdocs.pm/ecto/#!Ecto.Adapters.SQL.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With