Karen,
    Are you sure that vBillRate is NULL, and not some oddball unprintable character?
    What happens if you load all your variables with a SELECT INTO statement and then INSERT using
INSERT INTO sales (collist) VALUES (.var1,.var2,etc...)?
                                        Jason
Jason Kramer
University Archives and Records Management
002 Pearson Hall
(302) 831 - 3127 (voice)
(302) 831 - 6903 (fax)

On 3/15/2010 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





Reply via email to