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