× 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.



----- Original Message -----
From: <rob@dekko.com>
To: <rpg400-l@midrange.com>
Sent: Tuesday, March 12, 2002 8:26 AM
Subject: RE: Integers with embedded SQL problem


> 2)  If it did, then why did the UPDDTA or INSERT allow me to put
> 1,000,000,000 in the record?  This is not a valid binary value.

It let you do it because the DEC type is packed decimal. Then in the
program, you asked for 10 digits, integer or binary, you got them.

In the RPG program you declared 10i. But take a look at the cross reference.
This is what I ranted about not too long ago. It will probably show up in
the RPG cross reference as packed decimal. RPG does this to you.

Declaring the file in SQL as INT will present a binary 9 digit field.
Declaring SMALLINT will present a 4 digit field.

These are not pre-compiler issues, they are DDL issues. (Data Definition
Language, part of SQL.)

The result is as you did, if you really need 10 digits, the NUMERIC for
zoned, DEC for packed or live with 9 on INT.

For the case of the 5 digits, then you need INT for 9, NUMERIC for zoned,
DEC for packed, but SMALLINT won't hold it after the DDL materializes in the
physical file.

===========================================================
R. Bruce Hoffman, Jr.
 -- IBM Certified Specialist - iSeries Administrator
 -- IBM Certified Specialist - RPG IV Developer

"Suppose you were an idiot...
  And suppose you were a member of Congress...
  But I repeat myself."
    - Mark Twain





As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.