home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.databases
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!sdd.hp.com!ux1.cso.uiuc.edu!news.cso.uiuc.edu!e.oim.uiuc.edu!ternent
- From: ternent@oima2.oim.uiuc.edu (John Ternent)
- Subject: Re: Help in Rbase!
- References: <7636@stan.xx.swin.oz.au>
- Message-ID: <ternent.15@oima2.oim.uiuc.edu>
- Summary: Help in Rbase
- Sender: usenet@news.cso.uiuc.edu (Net Noise owner)
- Organization: Office for Information Management, University of Illinois
- Date: Mon, 14 Dec 1992 22:10:37 GMT
- Keywords: Rbase, Database
- Lines: 52
-
- In article <7636@stan.xx.swin.oz.au> skt@stan.xx.swin.oz.au (TANG S) writes:
-
- >I am a new user of Rbase. I have a simple problem here with Rbase. I hope
- >someone out there who are familiar with Rbase can help me. I am using Rbase 3.1.
- >I want to check if a variable is already in a column of a specified table.
- >I have tried several ways, but did not work. The following are some of the
- >IF statements I have tried.
-
-
- >(1)
- >IF itemid EXISTS (SELECT EE# FROM LTrans WHERE EE# = .itemid) THEN
- > ...
- >ELSE
- > ...
- >ENDIF
-
-
-
- >(2)
- >IF itemid IN (SELECT EE# FROM LTrans WHERE EE# = .itemid) THEN
- > ...
- >ELSE
- > ...
- >ENDIF
-
-
- >(3)
- >IF (SELECT EE# FROM LTrans WHERE EE# = .itemid) IS NOT NULL THEN
- >...
- >ELSE
- >...
- >ENDIF
-
-
- >Thanks in advance. Please email to me.
-
-
-
- I'm not sure this is exactly what you want, but when I try to do this kind
- of validation, I use the following syntax:
-
- SET VAR vTest = EE# IN LTrans WHERE EE# = .itemid
- IF vTest IS NULL THEN
- ...
- ELSE
- ...
- ENDIF
-
- Hope this helps!
-
- John Ternent
- j-ternent@uiuc.edu
-