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: Kevin English <kenglish_at_4csoftware.com>
Date: Mon, 13 Jan 2003 08:30:14 -0700
Message-ID: <lhm52vgqm13gcheoet2f2p6a7a8le9i1k3@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


Received on Mon Jan 13 2003 - 09:30:14 CST

Original text of this message

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