List:MySQL++« Previous MessageNext Message »
From:Steve Orton Date:April 7 2006 5:21pm
Subject:NULL field comparison
View as plain text  
  I'm fairly new to mysql and I have a question about finding out if a particular field is
NULL for type int and varchar.  Using the quick example in the "User's Guide", I tried
comparing the contents returned by to the Null object and to mysqpp::null and get a
"using == produces an ambiguous comparison" or something to that effect for both.

I tried this:

  mysqlpp::Null<int, mysqlpp:NulIsZero> myfield
  myfield = mysqlpp::null;
  if ( == myfield)
    retVal = 0;
    retVal = -999;

Which produces the following compile error:
  "ambiguous overload for 
    'const mysqlpp:ColData == mysqlpp::Null<int, mysqlpp::NullIsZero>&'

I then tried this:
  if ( == mysqlpp::null)
    retVal = 0;
    retVal = -999;

which produces:

  "no match for 'const mysqlpp::ColData == const mysqlpp::null_type&' operator"

  Section 3.8 of the "User's Guide" doesn't go into any more detail and I could not find
any examples on this type of NULL usage.  It's probably simple, but I can't see it.

  Any insight on this would be greatly appreciated...steve---

Steven J Orton
Software Engineer
Northrop Grumman Mission Systems
[Email] steve.orton@stripped

NULL field comparisonSteve Orton7 Apr
  • Re: NULL field comparisonWarren Young7 Apr
RE: NULL field comparisonSteve Orton10 Apr
RE: NULL field comparisonSteve Orton10 Apr