Re: Pro*C bind variables to Insert Blanks

From: John W. Bito <jwb_at_megasoft.com>
Date: 1997/04/11
Message-ID: <860764274.29687_at_dejanews.com>#1/1


In article <5ij7jq$d5o_at_inet-nntp-gw-1.us.oracle.com>,   surman_at_dlsun338.us.oracle.com (Scott Urman) wrote:

Hello Scott,

Thank you for your response. I hope that the approach you suggest will work, but I haven't been successful with it, yet. Please see below.

> In article <860634738.13397_at_dejanews.com>, John W. Bito <jwb_at_megasoft.com>
 writes:
> |> I have encountered a behavior that I don't expect using Pro*C dynamic
> |> embedded SQL. When I bind a string buffer to a variable in the VALUES
> |> clause of
> |> INSERT INTO x VALUES (:var, :othervar)
 [...]
> |>
> |> sqlda.V[0] = &var;
> |> sqlda.T[0] = 1 /* CHAR */
> |> sqlda.L[0] = 15;
> |> sqlda.I[0] = NULL;
> |> sqlda.V[1] = &othervar;
> |> sqlda.T[1] = 1 /* CHAR */
> |> sqlda.L[1] = 15;
> |> sqlda.I[1] = NULL;
>
> You are using external datatype 1, VARCHAR2. All trailing blanks will be
 stripped
> from variables of this type before inserting them into the database. In your
> case, all the blanks are stripped, resulting in a zero length string, which is
> inserted as NULL. Try using datatype 96, CHAR, instead.

I thought that the use of 96 would correct the problem, but I couldn't find it in the version of the Precompilers book that I have on-hand. When I tried plugging 96 in, however, SQLCODE was set to -3115(?) - invalid network datatype.

I wonder whether there is problem with my configuration. Would this result occur if I had an Oracle 6 precompiler library talking to an Oracle 7 server? Is type 96 supported by Oracle 6 servers?

I will try to verify what is happening when I get the bad SQLCODE.

Thank you again,
John Bito
DataFocus, Inc.
mailto:jwb_at_datafocus.com

-------------------==== Posted via Deja News ====-----------------------
      http://www.dejanews.com/     Search, Read, Post to Usenet
Received on Fri Apr 11 1997 - 00:00:00 CEST

Original text of this message