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



Bruce,

Time to update that certification.......

With SQL I can create a table on the AS/400 with a field SMLINT, this attribute 
CAN hold 32767 (notice the 5 digits).

With SQL I can create a table on the AS/400 with a field INT, this attribute 
CAN hold 2147483647 (notice the 10 digits)

On the AS/400 I can with:
RPGLE
SQL

Write, Update, Read  this field with a value of 32767

With embedded SQL
I CAN NOT


THIS IS THE ISSUE!



>>> rbruceh@attglobal.net 03/12/02 06:18AM >>>
----- 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



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