Transfer of Character Data between Pro*C Programs and Oracle Databases
(Doc ID 69130.1)
Last updated on FEBRUARY 01, 2022
Applies to:
Precompilers - Version 6.0.36.0 to 12.1.0.2 Information in this document applies to any platform.
Information in this document applies to any platform.
Purpose
Character information can be stored in C in many different ways. During the life of the Oracle Pro*C Precompiler, the way that character data is treated has changed to make life easier for the Developer.
This article highlights those changes and the benefits they bring so that developers can use the precompiler more effectively. It can also be used by developers upgrading programs written in earlier versions of the precompiler, or migrating precompiler applications from third party vendors.
Note that when char (lower case) is used, variables declared in the form:
char varname[n];
are being referred to.
Character pointers (char *) have always been treated as null terminated strings.
Scope
This article begins with a history of the use of char variables and the changes that were introduced with successive versions of the precompiler.
It then goes on to discuss external data formats and datatype equivalencing in more detail and the effects of various precompiler options, highlighting some of the common issues.
Finally, it reviews how this affects the use of the VARCHAR pseudotype and finishes with recommendations on the best way to approach this in the most recent versions of the precompiler.
Details
To view full details, sign in with your My Oracle Support account.
Don't have a My Oracle Support account? Click to get started!