[odb-users] Using odb with oracle: stored procedures and cursors

Marco Craveiro marco.craveiro at gmail.com
Fri Feb 10 03:50:00 EST 2017


Hi Boris,

thanks for the prompt reply.

<stored procs in oracle>
> We haven't got a test for it yet but it could already be working if
> Oracle returns the result in a way similar to a SELECT query (and
> all indications point to this being the case). If so, then calling
> a procedure would require a view along these lines:
>
> #pragma db view query("CALL my_stored_procedure(?)")
> struct my_stored_procedure
> {
>   ...
> };
>
> And then:
>
> using query = odb::query<my_stored_procedure>;
>
> db.query<my_stored_procedure> (query::_val (123) + "," +
>                                query::_val ("abc"));
>
> I could whip up a test if you are interested.

actually don't worry just yet - I changed the code to select the table
directly and that is working quite well. If we end up having to use
procs, I will use this to update the code and test it and give you
guys feedback.

> You mean multiple result sets (e.g., sets of rows from multiple,
> potentially different, SELECT statements)? If so, that would most
> likely require extra, potentially non-trivial, support.

Yes, unfortunately that is exactly what the procs are currently doing!
However, I will try to bypass these procs altogether as they don't
seem to fit the ODB/ORM model.

Cheers
-- 
Marco Craveiro

MD, Domain Driven Consulting
about: http://about.me/marcocraveiro
blog: http://mcraveiro.blogspot.co.uk
twitter: https://twitter.com/MarcoCraveiro

That the Ideas are themselves manifestations (of the Idea-Idea) and
that the Idea-Idea is a-kind-of Manifestation-Idea—which is a-kind-of
itself, so that the system is completely self-describing— would have
been appreciated by Plato as an extremely practical joke [Plato]. --
Alan Key



More information about the odb-users mailing list