Re: PROC: Dynamic SQL

From: Brad Maxwell <bcmaxwel_at_ingr.com>
Date: 1996/07/26
Message-ID: <31F8DD55.3F9F_at_ingr.com>#1/1


Vandra Huber wrote:
>
> Reinhard Schmidt wrote:
> >
> > > Hi All,
> > > I have a Probelm with dynamic sql in PRO*C.
> > > the sql statement is like " select * from mytable where name = :f1".
> > > it works fine if the bind variable has all the N chars , where N
> > > is the length of the coulmn name. but it returns nothing if the bind
> > > variable has a value whose length is less than the column
> > > length. Any ideas?
> > >
> > > thanks a lot, ash.
> > >
> > Is your bind variable char or varchar. I recommend to use varchar and to set
> > varchar.len accordingly.
> >
> > ----
> >
> > Reinhard Schmidt Reinhard_at_schmidt.do.eunet.de
>
> EXEC SQL select ... into :myVariable :myIndicatorVariable ...;
>
> The variable is 0 (zero) if successful, -1 if null or +1 if ???
> In any case, if the indicator is not there, nothing is done..

I'd like to complicate this question further.

I have a situation where I don't know how much space to allocate before I fetch. I've got binary data in a LONG RAW field and the user could have stored as much data as he wanted (within the limits). I can make a guess at how much to allocate before my fetch, but if it fails, I can't go reallocate and try again because I don't have a unique key for that table to identify the row that gave me the problem.

Any ideas?

Brad Received on Fri Jul 26 1996 - 00:00:00 CEST

Original text of this message