[DB-SIG] Oracle no longer wants positional arguments!
Paul Boddie
Paul Boddie <Paul.Boddie@cern.ch>
Tue, 23 Jun 1998 18:03:59 +0200 (MET DST)
Jim Fulton <jim.fulton@Digicool.com> wrote:
> I happen to be working on a new Oracle module that needs to
> work with Oracle 8 and I noticed something interesting.
Right! I thought someone was working on a new module. Now I know I didn't just
make it up!
> The Oracle OCI call, obindrn, that lets you use positional
> placeholders, as in:
>
> select * from spam
> where foo=:1
>
> is now considered "obsolete"!
I noticed that named placeholders were supported in OCI, and wondered why they
weren't utilised by oracledb...
> Oracle wants you to use named variables, like:
>
> select * from spam
> where foo=:foo
>
> Aparently, you were already (at least in Oracle 7)
> not allowed to use positional placeholders in PL/SQL
> blocks.
>
> Oops. ;-)
In the PL/SQL probably not, but it is possible to call PL/SQL procedures using
OCI with numbered placeholders.
> Maybe we should think about a less position-oriented interface,
> perhaps using keyword arguments or a dictionary
> to pass values into execute.
>
> (Note that I'd still prefer a more function-like
> interface, as in:
>
> f=connection.prepare(some_sql)
> result=f(arg1=v1, arg2=v2)
> )
Hmmm... I think that (naming and notation issues introduced in the example above
aside) dictionaries would provide a fairly convenient interface to the
parameters of stored procedures, which I was working on for oracledb-0.1.3.
I posted a bit of a concern about the disconnection/commit relationship in
oracledb. Are you in a position to comment about that? (Given that the oracledb
module is unsupported, of course.)
Paul Boddie Paul.Boddie@cern.ch
| http://assuwww.cern.ch/~pboddie
| Any views expressed above are personal and not necessarily
| shared by my employer or my associates.