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

Home -> Community -> Usenet -> c.d.o.server -> Re: Dynamic SQL - proC - Method 4

Re: Dynamic SQL - proC - Method 4

From: Sylvain Benoist <sylvainb_at_whitepj.com>
Date: Tue, 24 Jul 2001 10:15:36 -0700
Message-ID: <k3i77.31$hI3.28305@news.pacbell.net>

"Erwin Dondorp" <erwindon_at_wxs.nl> wrote in message news:3B5D2932.615C0D6C_at_wxs.nl...
> Sylvain Benoist wrote:
> > When we want to get some data from the database by using this
 application,
> > everything works fine except with the "string" fields. Indeed, if the
 type
> > of one field is varchar(10) and this field contains 4 characters, the
> > Dynamic SQL method 4 will return a string containing 10 characters with
 the
> > 4 corresponding characters + 6 spaces.
>
> You need to set s->T[i] to 5 ("C"-string) of the varchar2 columns.
> You probably used 1 ("char") or 9 ("varchar").
>
> Erwin
>

Hi,
I see what you mean and I tried it. What I did is I tried to coerce the varchar datatype to STRING, by using the following statement:

/* Coerce select-list value to STRING */

select_des->T[i] = 5;

But the length returned is still the maximum length of the varchar field.

I also tried to set the T array of datatype codes to tell Oracle the external datatype of each bind variable ( Oracle is supposed to do any necessary conversion between external and internal datatypes at OPEN time, by using the following statement :

bind_des->T[i] = 5;

But it doesn't work.

Thank you for your help.

Sylvain. Received on Tue Jul 24 2001 - 12:15:36 CDT

Original text of this message

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