Re: Pro*C:How to do "where column =:char_host_var" ?

From: Michaeljon Miller <mikem_at_apertus.com>
Date: Mon, 10 Oct 1994 15:10:29 GMT
Message-ID: <CxGq5J.2A5_at_apertus.com>


In article <jshowers-0510940946410001_at_mac25.cmi.on.ca>, jshowers_at_cmi.on.ca (Jodi Showers) writes:
|> In article <36ni60$824_at_raffles.technet.sg>, scornd11_at_solomon.technet.sg
|> (Nicholas Wee) wrote:
|>
|> > ProC examples in the book only show selection criteria using
|> > integer host variables but NO examples I know show char variables.
|> > When I managed to code it, it works sometimes and not other
|> > times eg. "where column like :char_host_var" which works on
|> > some machines and not on others... really weird !!!???
|> >
|> > Anyone with some code out there that really works all the
|> > time on all machines...?
|> >
|> > Thanks.
|>
|> Always declare :char_host_var as VARCHAR(!char) - you'll get
|> unpredictable results otherwise.

   Not true. At least not under Pro*C 1.5 and above. If you use the MODE=ANSI flag and indicator variables (ALWAYS USE INDICATOR VARIABLES) you'll have no problem with char[] variables. You won't have to deal with converting the varchars to c strings and catch the null terminators either.

mj

-- 
Michaeljon Miller                                      mikem_at_apertus.com
Proficient Solutions, Inc.                     612-860-2181/612-698-6389
2285 Stewart Ave  #1404                               St. Paul, MN 55116
Received on Mon Oct 10 1994 - 16:10:29 CET

Original text of this message