× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Within SQL, the following holds true:

SQL_CHAR = Fixed-length Alphanumeric
SQL_VARCHAR = alpha prefixed by length (VARYING in RPG)
SQL_NUMERIC = zoned decimal
SQL_DECIMAL = packed decimal
SQL_SMALLINT = 2-byte integer
SQL_INTEGER = 4-byte integer
SQL_BIGINT = 8-byte integer
SQL_FLOAT = 4 byte floating-point
SQL_DOUBLE = 8-byte floating point

Some CLI APIs will attempt to make a conversion from these types to stuff supported in C. For example, CHAR or VARCHAR might be converted to a null-termated string. So, sometimes you have to make a distinction between the SQL types (listed above) and the C types (SQL_C_CHAR, et al).


On 3/2/2011 11:20 AM, Dennis Lovelady wrote:
I have been scanning the web looking for a made-for-humans chart that
will describe the various SQL CLI values and how they relate to our
beloved i. There are a few references that make a feeble attempt at
correlating [some of] these values against C object types, but these
fall way short, especially when it comes to Packed vs. Zoned, et cetera.
(This is made more confusing that the terms PACKED and ZONED don't even
apparently make it to the SQL CLI vocabulary, and are apparently
replaced by the ambiguous SQL_NUMERIC and SQL_DECIMAL (?) terms. But I
digress.)

Some of the ambiguities are: SQL_BIGINT, SQL_BINARY, SQL_INT,
SQL_NUMERIC, SQL_SMALLINT. Then there's SQL_FLOAT, SQL_REAL and
SQL_DECFLOAT. That's just for starters. Obviously, some of these are
synonyms for others, but that knowledge by itself isn't much help.

Where may I find a chart or other reference that will help me decipher
the SQL data types, in hopes that a clever routine may make use of this
information for conversion purposes?
--
Programming: An act similar to banging one's head against a wall, but
with fewer opportunities for reward.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.