home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / database / 8482 < prev    next >
Encoding:
Text File  |  1992-12-14  |  1.5 KB  |  66 lines

  1. Newsgroups: comp.databases
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!sdd.hp.com!ux1.cso.uiuc.edu!news.cso.uiuc.edu!e.oim.uiuc.edu!ternent
  3. From: ternent@oima2.oim.uiuc.edu (John Ternent)
  4. Subject: Re: Help in Rbase!
  5. References: <7636@stan.xx.swin.oz.au>
  6. Message-ID: <ternent.15@oima2.oim.uiuc.edu>
  7. Summary: Help in Rbase
  8. Sender: usenet@news.cso.uiuc.edu (Net Noise owner)
  9. Organization: Office for Information Management, University of Illinois
  10. Date: Mon, 14 Dec 1992 22:10:37 GMT
  11. Keywords: Rbase, Database
  12. Lines: 52
  13.  
  14. In article <7636@stan.xx.swin.oz.au> skt@stan.xx.swin.oz.au (TANG S) writes:
  15.  
  16. >I am a new user of Rbase.  I have a simple problem here with Rbase.  I hope 
  17. >someone out there who are familiar with Rbase can help me.  I am using Rbase 3.1.
  18. >I want to check if a variable is already in a column of a specified table. 
  19. >I have tried several ways, but did not work.  The following are some of the 
  20. >IF statements I have tried.
  21.  
  22.  
  23. >(1)
  24. >IF itemid EXISTS (SELECT EE# FROM LTrans WHERE EE# = .itemid) THEN
  25. >  ...
  26. >ELSE
  27. >  ...
  28. >ENDIF
  29.  
  30.  
  31.  
  32. >(2)
  33. >IF itemid IN (SELECT EE# FROM LTrans WHERE EE# = .itemid) THEN
  34. >  ...
  35. >ELSE
  36. > ...
  37. >ENDIF
  38.  
  39.  
  40. >(3)
  41. >IF (SELECT EE# FROM LTrans WHERE EE# = .itemid) IS NOT NULL  THEN
  42. >...
  43. >ELSE
  44. >...
  45. >ENDIF
  46.  
  47.  
  48. >Thanks in advance.  Please email to me.
  49.  
  50.  
  51.  
  52. I'm not sure this is exactly what you want, but when I try to do this kind
  53. of validation, I use the following syntax:
  54.  
  55. SET VAR vTest = EE# IN LTrans WHERE EE# = .itemid
  56. IF vTest IS NULL THEN
  57. ...
  58. ELSE 
  59. ...
  60. ENDIF
  61.  
  62. Hope this helps!
  63.  
  64. John Ternent
  65. j-ternent@uiuc.edu
  66.