Karen, One idea: you could do this:
IF vBillRate IS NULL THEN SET VAR vBillRateText = 'NULL' ELSE SET VAR vBillRateText = (CTXT(.vBillRate)) ENDIF And then replace .vBillRate in your insert with &vBillRateText On Mon, Mar 15, 2010 at 11:55 AM, <[email protected]> wrote: > A client is running build .30305, which I believe is the latest .. > > A program (run daily, untouched since 9/2009) does an insert into > a table using a combination of columns and variables. The syntax is: > > INSERT INTO sales + > (invoiceno, trandate, trantime, accountno, billaccount, brate) + > SELECT invoiceno, .#DATE, .#TIME, accountno, .vmacctno, .vBillRate + > FROM tempsales WHERE ..... > > The 2 variables referenced (vmacctno and vbillrate) are predefined, and are > populated by a "select into". However, the vBillRate could be null. In > that > case, I see it in my variable list as > vBillRate REAL with no value > > I swear this must have happened before (but maybe not), but when vBillRate > is null, > the insert fails and I get the message > "An expression cannot end with binary operator" > > If I replace the vBillRate with a 0 , then the insert works. Whileopt is > OFF, Zero is ON. > > My null setting is the default -0-. If I change the null setting to ' ' > (blank space) > right before the insert, the insert still fails but with: > "incorrect number of values for this table" > > So now I'm pretty worried about other places I might have a null variable > being > inserted... What do other programmers do? Is this bad programming? > Should > each variable be populated with something? What if you want a number value > to be truly null, and not a 0? > > Karen > >

