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



On 25 Mar 2013 07:12, Raul A. Jager W. wrote:
In RPG (and other languages) I can declare a 1 Byte number, signed
for -128 to 127 and unsigned 0 to 255, which will be something
like a "half small integer".

But I could not find a way to define such a field in SQL. Is it
possible?

Depending upon actual requirements, the desired effects may be achieved with the SQL, using a CHECK CONSTRAINT. For example, the following ensures the values are within the specified bounds, even though the data type for its implementation remains a 2-byte integer:

create table dltmeint
( byteint smallint
, constraint "8bitInteger" check(byteint between -128 and 127)
)
;
insert into dltmeint values
( -2**7 ), ( 2**7 -1 )
;


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.