Re: PROC: Dynamic SQL
Date: 1996/07/31
Message-ID: <4tnu9q$dab_at_news.aimnet.com>#1/1
Brad Maxwell (bcmaxwel_at_ingr.com) wrote:
: 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?
:
Don't know if this would work, but ....
how about selecting the rowid and vsize of the column (vsize is
an Oracle function that return the number of bytes).
Then allocate the space based on vsize.
Then perform the select of the actual data using the rowid.
Tony Damon Received on Wed Jul 31 1996 - 00:00:00 CEST