I use Razzak’s code, but with the addition of ‘AND LIMIT = 1’ causing the search to stop when it finds the first row. Albert
> On Feb 5, 2019, at 6:28 PM, A. Razzak Memon <[email protected]> wrote: > > Jan, > > Here is one approach to validate the existence of a row ... > > SET VAR vRows INTEGER = 0 > SELECT COUNT(*) INTO vRows INDICATOR iv1 FROM PODetail WHERE PO_ID = .vPOID > AND ReceiptStatus = 'P' > > IF vRows = 0 THEN > CLS > PAUSE 2 USING 'No record found!' CAPTION 'Receipt Status' ICON WARNING + > BUTTON 'Press any key to continue ...' + > OPTION BACK_COLOR WHITE + > |MESSAGE_FONT_NAME Tahoma + > |MESSAGE_FONT_COLOR RED + > |MESSAGE_FONT_SIZE 12 > GOTO Done > ENDIF > > -- Do what you have to do here ... > -- Example > CLS > EDIT USING ReceiptStatus WHERE PO_ID = .vPOID AND ReceiptStatus = 'P' > LABEL Done > CLEAR VARIABLES iv%,vRows > RETURN > > Hope it helps! > > Razzak > > > At 06:41 PM 2/5/2019, jan johansen wrote: > >> All, >> >> I think I need a SQL refresher. >> I need to update old code that looks like this. >> >> SET ERROR VAR hold >> SET VAR vchk = ReceiptStatus IN PODetail WHERE PO_ID = .vPOID AND >> ReceiptStatus = 'P' >> IF hold = 0 THEN >> >> So is >> IF hold = 0 the same as >> IF SQLCODE = 0? >> >> Sorry such a dumb question. >> >> Jan >> >> -- >> For group guidelines, visit >> <http://www.rbase.com/support/usersgroup_guidelines.php >> <http://www.rbase.com/support/usersgroup_guidelines.php>>http://www.rbase.com/support/usersgroup_guidelines.php >> <http://www.rbase.com/support/usersgroup_guidelines.php> >> --- >> You received this message because you are subscribed to the Google Groups >> "RBASE-L" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to <mailto:[email protected] >> <mailto:[email protected]>>[email protected] >> <mailto:[email protected]>. >> For more options, visit <https://groups.google.com/d/optout >> <https://groups.google.com/d/optout>>https://groups.google.com/d/optout >> <https://groups.google.com/d/optout>. > > -- > For group guidelines, visit > http://www.rbase.com/support/usersgroup_guidelines.php > --- You received this message because you are subscribed to the Google Groups > "RBASE-L" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. -- For group guidelines, visit http://www.rbase.com/support/usersgroup_guidelines.php --- You received this message because you are subscribed to the Google Groups "RBASE-L" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.

