List:MySQL++« Previous MessageNext Message »
From:Bassam A. Al-Khaffaf Date:February 27 2007 8:26am
Subject:RE: How to overcome a runtime error when there is no matching in database
View as plain text  
Your solution doesn't work with my case. The "attributeList" is always fill
with data, however, I just want to retrieve "attribute_name" if available
otherwise I get NULL or anything that may indicate there is no such record. 

Any solution please?

Regards
Bassam


-----Original Message-----
From: Warren Young [mailto:mysqlpp@stripped] 
Sent: Tuesday, February 27, 2007 11:54 AM
To: MySQL++ Mailing List
Subject: Re: How to overcome a runtime error when there is no matching in
database

Bassam A. Al-Khaffaf wrote:
> 
> Cout << attributesList.lower_bound(_ATTRIBUTES_LIST(attribute_id,
> vendor_id))->attribute_name << endl;
> 
> However, I am getting a runtime error when there is no  (attribute_id,
> vendor_id) matching in my database so how can I control or overcome this
> error.


What's wrong with this:

if (attributesList.size()) {
	cout .... etc.
}
else {
	cerr << "No results found" << endl;
}

??

-- 
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe:
http://lists.mysql.com/plusplus?unsub=1

-- 
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.446 / Virus Database: 268.18.4/703 - Release Date: 2/26/2007
2:56 PM
 

-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.446 / Virus Database: 268.18.4/703 - Release Date: 2/26/2007
2:56 PM
 

Thread
How to overcome a runtime error when there is no matching in databaseBassam A. Al-Khaffaf26 Feb
  • Re: How to overcome a runtime error when there is no matching indatabaseWarren Young27 Feb
    • RE: How to overcome a runtime error when there is no matching in databaseBassam A. Al-Khaffaf27 Feb
      • Re: How to overcome a runtime error when there is no matching indatabaseWarren Young27 Feb
        • RE: How to overcome a runtime error when there is no matching in databaseBassam A. Al-Khaffaf27 Feb
          • Re: How to overcome a runtime error when there is no matching indatabaseWarren Young28 Feb