I tried that. It didn't change anything.

If I set null '' then it seems to work. If I set it -0- then my code does not 
work , and I see the -0- in the variable.

If I set null in code, does that affect just the user who is running that code, 
or everyone?

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Buddy
Sent: Sunday, February 17, 2013 6:43 PM
To: RBASE-L Mailing List
Subject: [RBASE-L] - RE: Variable in Cursor

Check your null setting by doing this at the R:>prompt

R:>SHOW NULL

If you don't see -0- and your MI column has -0- then there was a problem when 
the data was loaded.

I would suggest updating the MI by doing this

R:>UPDATE tableName SET MIcolumn = NULL WHERE MIcolumn = '-0-'

Buddy


-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Kayza Kleinman
Sent: Sunday, February 17, 2013 5:59 PM
To: RBASE-L Mailing List
Subject: [RBASE-L] - RE: Variable in Cursor

This is the relevant code:
declare inRows cursor for +
 select Clientid,LASTNAME,FSTNAME,m_i_,MaidenName from CCClientsStage2

OPEN inRows

FETCH inRows into vClientid, vLastname, vFstname,  vMI, vMaidenName + indicator 
vIndicator

        .
        .
        .
set var vFullName = .vLASTNAME+ ',' & .vFSTNAME& .vMI set var vMainID = 
clientid from maininfo where +
    tot_name = .vFullname


Tot_Name is a field that concatenates Lastname, Fstname and MI. I had 
originally tried the comparison using each variable to each field. Lastname and 
Fstaname always have a value. MI is often blank. In the concatenated field, I 
just see nothing when there is a blank in MI, but in the variable I see -0-


-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Buddy
Sent: Sunday, February 17, 2013 4:28 PM
To: RBASE-L Mailing List
Subject: [RBASE-L] - RE: Variable in Cursor

Kayza
   How are you comparing the null value. Also make sure you are using the 
indicator when selecting values from the column

    FETCH c1 INTO varName INDIC ivarName ....

   IF varName IS NULL THEN
      Do something here
   ENDIF


   You could also test for NULL
  
   IF ivarName = -1 THEN
      Do something here because varName IS NULL
   ENDIF

Hope this helps.

Buddy


-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Kayza Kleinman
Sent: Sunday, February 17, 2013 3:33 PM
To: RBASE-L Mailing List
Subject: [RBASE-L] - Variable in Cursor

I have a cursor set up and I'm comparing the values in the cursor to values in 
a different table. The problem is that when I pull the values in the cursor 
into variables, if the value in the column is null, the value of the variable 
shows up as a literal -0-. This is a problem because the when I do a comparison 
to the main table, it doesn't work. When there is a value it does work.

Any ideas?


Kayza Kleinman
CIO &
Director, Nonprofit Helpdesk
Jewish Community Council of Greater Coney Island, Inc
3001 West 37th Street
Brooklyn NY 11224
718 449-5000 x 2266
fax 718 946-8240

http://kayzasblog.nphd.org/
www.jccgci.org<http://www.jccgci.org/>
www.nphd.org<http://www.nphd.org/>

Helping you do good - better.


Reply via email to