Marc, As other have mentioned, I would be very hesitant to change the NULL setting as it is global and as soon as you change it, it affects every other user. If you want to store blank spaces instead of "-0-" you can always do it with code, just use ' ' (quote-blank-quote) rather than NULL defined as a blank space; keep in mind that using blanks (instead of a true NULL value) can create other problems as well. A NULL value, i.e. absence of data and a blank space are not the same thing; there have been several threads in the past on this issue. Also, if you do not want to display "-0-' in reports, all the newer versions allow you to define a default format for the filed/column such as "N.A."; so, at least in reports, this is no longer an issue. In the code itself, the SET NULL command after the "IF SQL." is redundant. Also I would code SET NUL '-0-' (with quotes) instead of SET NULL -0- (without quotes). Javier, Javier Valencia, PE 913-829-0888 Office 913-915-3137 Cell 913-649-2904 Fax <mailto:[email protected]> [email protected] _____
From: [email protected] [mailto:[email protected]] On Behalf Of MDRD Sent: Thursday, March 17, 2011 2:03 PM To: RBASE-L Mailing List Subject: [RBASE-L] - Re: Data corruption Karen This the code... thanks Marc LABEL tcstart RUN fcust IN prog7.apx IF (LASTKEY(0)) = '[ESC]' THEN GOTO tcend ENDIF SET VAR vcust INTEGER = .cust# IF cust# IS NOT NULL THEN SET NULL ' ' EDIT USING t1c WHERE custnum = .cust# + ORDER BY txdate ASC CAPTION 'Travel Card' IF SQLCODE = 100 THEN SET NULL ' ' INSERT INTO travcard (custnum,txdate) VALUES (.cust#,.#DATE) EDIT USING t1c WHERE custnum = .cust# + ORDER BY txdate ASC CAPTION 'Travel Card' ENDIF SET NULL -0- GOTO tcstart ENDIF LABEL tcend From: [email protected] Sent: Thursday, March 17, 2011 1:38 PM To: RBASE-L Mailing List <mailto:[email protected]> Subject: [RBASE-L] - Re: Data corruption Marc: Since you say "they stay in a Loop", is this a While loop? Do you have whileopt set off? Nothing can chew up memory and cause problems more than having whileopt on and not followig "the programming rules". Karen I will check the Var's, I never really thought of that since they stay in a Loop Dialog ... Custnum Edit Using Form click a few buttons, maybe type in the Varchar field Exit to the Dialog box and then do the next Custnum Worth taking a second look, but if I have to do over 10 rows to find the problem it may make it hard. Marc

