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



I tested this out with the following:
CREATE TABLE ROB/thefile (THENBR DEC ( 10, 0) NOT NULL WITH DEFAULT)
Then I add a record with a value of nine 9's and run the following:
     D MyVar           s             10i 0

     C                   eval      MyVar=999999999
     C     MyVar         dsply
     C                   eval      MyVar=1000000000
     C     MyVar         dsply
     C/exec sql
     C+ select TheNbr into :MyVar from TheFile
     C/end-exec
     C     MyVar         dsply
     C                   eval      *inlr=*on

and it works.  Then I change the value in the file from nine 9's to
1,000,000,000 and it fails with a MCH1210 "Receiver value too small to hold
result."

>From the ILE RPG reference, chapter 10, page 181:
Because of these length restrictions, the highest decimal value that can be
assigned to a 2-byte binary field is 9999 and the highest decimal value
that can be
assigned to a 4-byte binary field is 999 999 999.

>From the ILE RPG reference, chapter 10, page 184:
Field length       Range of Allowed Values
10-digit integer   -2147483648 to 2147483647

Therefore I agree with you, the precompiler seems to only be converting
integer to binary.

Rob Berendt
--
"They that can give up essential liberty to obtain a little temporary
safety deserve neither liberty nor safety."
Benjamin Franklin



                    "Andrew Lutz"
                    <alutz@pmigroup.c       To:     "<"
                    om>                     cc:
                    Sent by:                Fax to:
                    rpg400-l-admin@mi       Subject:     Integers with embedded 
SQL problem
                    drange.com


                    03/11/2002 04:11
                    PM
                    Please respond to
                    rpg400-l







All,

I have this situation where the pre-compiler insists that small integer is
4B0 and interger is 9B0

Has anyone found out how to insert the value that a small integer is
capable of (32676) via embedded SQL?




_______________________________________________
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@midrange.com
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/cgi-bin/listinfo/rpg400-l
or email: RPG400-L-request@midrange.com
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.







As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.