Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: SQLT_CHR and null-values in OCI
Actually its more than that.
SQLT_CHR - N character string for VARCHAR2 SQLT_STR - N+1 character NULL terminated string for VARCHAR2 SQLT_AFC - N character string for CHAR columns (so it enforces Ncharacters)
You may find that trailing spaces are truncated when you use SQLT_CHR or SQLT_STR. So if you only have spaces in your string, boom they are gone. By using SQLT_AFC you are forcing the driver/server to say that this string is 'N' characters long and DO NOT truncate it. ;-)
Oracle defines empty string to be equal to NULL. However you may find other
databases have even weird behavior.
For e.g. I think Sybase has empty string as 1 byte space character and NULL
is not same as empty string.
HTH,
Want ease of development or performance? Why not get both! http://www.roguewave.com/products/sourcepro/db/
[Disclaimer: All views expressed here are my personal views
and they can be incorrect at times]
"Tommi Mäkitalo" <t.maekitalo_at_epgmbh.de> wrote in message
news:ubvuib.4te.ln_at_192.168.31.31...
> Amit wrote:
>
> > Try using SQLT_AFC.
> >
> >
> Yes - that worked.
>
> The difference between SQLT_CHR and SQLT_AFC seems to be, that SQLT_AFC
> works and SQLT_CHR not, isn't it?
> Does the same difference apply to SQLT_STR and SQLT_AVC?
>
> Tommi Mäkitalo
Received on Tue Sep 02 2003 - 16:49:04 CDT