Re: Fw: BUG #1862: ECPG Connect, host variable trailing blanks

Started by Jim Grayover 20 years ago1 messagesbugs
Jump to latest
#1Jim Gray
jim.gray@bull.com

Does Oracle really munge data on the client side? Or does it, like
PostgreSQL, pass the host variable's value as-is to the server, and
the server considers trailing spaces significant or not depending
on the context?

The Oracle C preprocessor/client library has an option to strip trailing
blanks.
I believe that the Oracle preprocessor/client library always does this,
and that the Oracle server
is unaware of any of this and uses whatever characters are sent to it, as
is.
We couldn't find a similar option for Postgres C.

Is it the client-side behavior or the server-side
behavior that's different between PostgreSQL and Oracle?

We haven't found any difference between connect variables and other
variables in the Oracle server.
There appears to be no context differences in handling variables in the
Oracle server, like there is for Postgres.

If Oracle strips trailing spaces on the client side, is that a
configurable option?

Yes, as described above it affects the client-side only.

How would you insert significant trailing
spaces into a VARCHAR column if the client library strips them?

The cobol structure with 2 level 49's for varchar within a cobol program
is handled separately
and is passed as-is to Oracle or Postgres . This is the way to pass
trailing spaces to or from Oracle.

There is a similar structure recognized by the C preprocessor (in both
Oracle and Postgres).
This is the way to get trailing spaces to Oracle, since the Oracle
preprocessor/library is
stripping trailing spaces.