Re: OCI describe parameters
Date: Thu, 05 Dec 2002 06:57:10 GMT
Message-ID: <3deef8bf_at_news.comindico.com.au>
Paul Dembry <pade_at_nospam.trifox.com> wrote:
> I want to describe the input parameters for the following:
>
> insert into moose values(?,?)
> or
> insert into moose(id,value) values(?,?)
>
> I want a method to know what the underlying moose columns' datatypes
> are. Why? Because LONG/LONG RAW must be handled differently from
> CLOB/BLOB and the incoming statements are dynamic. I have looked
> through the OCI 8 documents but nothing looks appropriate. Does
> anyone know if this can be done?
[Quoted] Prepare the statement with OCIPrepare(), then use OCIStmtExecute() in OCI_DESCRIBE_ONLY mode, then you can use OCIAttrGet() to get the OCI_ATTR_PARAM_COUNT attribute of the statement handle, then loop through, doing an OCIParamGet() on the statement handle to get an OCIParam handle for [Quoted] each parameter before using OCIAttrGet() on the parameter handle to retrieve [Quoted] the OCI_ATTR_DATA_TYPE and OCI_ATTR_DATA_SIZE attributes for each.
HTH, Ken Received on Thu Dec 05 2002 - 07:57:10 CET