Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to check negative integer values ? – PROGRESS 4GL

I have written a below query to see what are the possitive and negative integer values from a table fields. But I am not sure how to fetch only negative integer values.

DEFINE TEMP-TABLE ttdata NO-UNDO
FIELD iValue1 AS INTEGER
FIELD iValue2 AS INTEGER
.

CREATE ttdata.
ASSIGN
iValue1 = 122
iValue2 = -122
.

FOR EACH ttdata NO-LOCK:
  DISP iValue1 iValue2.
END.

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

a query just about one field where field < 0

FOR EACH ttdata NO-LOCK 
   WHERE ttData.iValue2 < 0:
    DISP iValue1 iValue2.
END.

when you have two fields with or, but dont use it on a real database table because it is very slow without any index

FOR EACH ttdata NO-LOCK 
   WHERE ttData.iValue2 < 0 
      OR ttData.iValue1 < 0:
    DISP iValue1 iValue2.
END.
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading