Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: OCI V8 - Get Number of Placeholders
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