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: Doubt about odesc OCI function

Re: Doubt about odesc OCI function

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Mon, 28 Jun 1999 14:52:00 GMT
Message-ID: <37798b9c.8499141@newshost.us.oracle.com>


A copy of this was sent to "Antonio Pascual" <apa_at_jerez.micro.lucent.com> (if that email address didn't require changing) On Mon, 28 Jun 1999 12:52:42 +0200, you wrote:

>Hi all.
>
>My problem is the following:
>
>I have a sentence like this
>INSERT INTO TABLE_1 ( FIELD1, FIELD2, ... ) VALUES( :FIELD1, :FIELD2, ... )
>
>This sentence a class to allow execute Prepared Statement. The Prepared
>Statements
>are generated dinamically, so i don't know anything about the fields.
>
>The problem comes because the obndrv function, needs to know the size of the
>field and i dont know it.

You have to know the size of the field -- You are supplying it!!!

For the insert statement you will be binding your INPUT variables to the insert statement. If you do not know their size (and that is the size you need to know -- not the database size), you have a problem :)

You do not figure out the datatypes of INPUT bind variables -- you tell us what you are willing to supply. On output, (eg: a select) we can tell you the datatypes and sizes we will be sending. On input (eg: an insert/update/delete) you tell us what you will be sending.

>I can obtain the size with the function odescr, but this function needs
>that, previously, the obndrv function
>has been called. This is what i have to do:
>
> oopen
> oparse
> for each column
> obndrv ( i dont know the size of the field, i put 0, for example )
> odescr
> // now i know the size of the field.
> end for
>
> and again
>
> oparse
> for earch column
> obndrv ( now, telling the field size to the function )
> end for
>
>This is what i suppose that i have to do after read the OCI Programmer's
>guide.
>
>Is this Right?
>If it is, there is any other easiest way to do it?
>
>I hope that i have explained cleared the problem.
>
>regards
>

--
See http://govt.us.oracle.com/~tkyte/ for my columns 'Digging-in to Oracle8i'... Current article is "Part I of V, Autonomous Transactions" updated June 21'st  

Thomas Kyte                   tkyte_at_us.oracle.com
Oracle Service Industries     Reston, VA   USA

Opinions are mine and do not necessarily reflect those of Oracle Corporation Received on Mon Jun 28 1999 - 09:52:00 CDT

Original text of this message

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