Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: OCI V8 - Get Number of Placeholders

Re: OCI V8 - Get Number of Placeholders

From: Jose Verissimo <jose.verissimo_at_tie.co.pt>
Date: 13 Jan 2003 10:49:40 -0800
Message-ID: <e1a86756.0301131049.685f425c@posting.google.com>


Kevin English <kenglish_at_4csoftware.com> wrote in message news:<lhm52vgqm13gcheoet2f2p6a7a8le9i1k3_at_4ax.com>...
> On 13 Jan 2003 04:07:15 -0800, jose.verissimo_at_tie.co.pt (Jose
> Verissimo) wrote:
>
> >Hello all!
> >
> >Does anyone know if there is a way to get the number of placeholders
> >from a sql statement?
> >
> >For instance, if I have the following sql statement:
> >"INSERT INTO emp VALUES (:empno, :ename, :job, :sal, :deptno)"
> >is there any method/attribute that can give me the number of
> >placeholders (5) after this satement has been prepared
> >(OCIStmtPrepare)?
> >
> >Thanks,
> >Jose Verissimo
> Hi,
> Although this does not do exactly what you ask for, it may be
> adequate. Try:
>
> OCIStmtExecute(...,OCI_DESCRIBE_ONLY);
> OCIAttrGet(...,OCI_ATTR_PARAM_COUNT,...);
> Then loop with multiple calls to
> OCIParamGet(...,OCI_HTYPE_STMT,...);
> (This is from Oracle Call Interface Programmers Guide, Appendix A)
>
> Hope this helps.
> Cheers
> Kevin English
>
> Posted Via Usenet.com Premium Usenet Newsgroup Services
> ----------------------------------------------------------
> ** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
> ----------------------------------------------------------
> http://www.usenet.com

Hi Kevin!

Thanks for you reply, but I'm afraid that won't do what I'm looking for... The sequence of commands you've suggested describes a Select List and I was looking for some kind of methods that would describe the placeholders.
In ODBC we have those methods (SQLNumParams and SQLDescribeParam) but I could not find anything similar in OCI...

Does anyone know if they exist?

Thanks,
Jose Verissimo Received on Mon Jan 13 2003 - 12:49:40 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US