Please take our Survey
logo       

Choosing A Webhost:
A web hosting service is a type of Internet hosting service that allows individuals and organizations to provide their own website accessible via the World Wide Web. Web hosts are companies that provide space on a server they own for use by their clients as well as providing Internet connectivity, typically in a data center. Web hosts can also provide data center space and connectivity to the Internet for servers they do not own to be located in their data center, called colocation. more...

RE: How to overcome a runtime error when there is no matching in database: msg#00055

db.mysql.c++

Subject: RE: How to overcome a runtime error when there is no matching in database

I am sorry for the shortage of the provided information. However, a partial
code snippet is shown below, take note that the "attributesList" container
is always containing records:

------------------------------------------------------
Structures.h file contains the following SSQLS:

sql_create_5(_ATTRIBUTES_LIST, 2, 0,
sql_smallint_unsigned, attribute_id,
sql_int_unsigned, vendor_id,
sql_varchar, vendor_name,
sql_varchar, attribute_name,
sql_smallint_unsigned, type_id);
------------------------------------------------------

Configurations.h files contains the following data members and member
functions:

#include "Structures.h"

Class Configurations.h
{
public:
Configurations(Query *configurationsQuery, const bool *debugMode)
{
populateAttributesInformation(configurationsQuery, debugMode);
}

string getAttributeName(unsigned short attribute_id, unsigned short
vendor_id)
{
/////Run time error occurs in the following step when
/////there is no match found. It is similar to the SQL
/////command "SELECT attribute_name FROM attributes_tabel
/////WHERE attribute_id = somevalue AND vendor_id = othervalue
/////It has to return a NULL or zero when there is no data are
////// found.
return attributesList.lower_bound(_ATTRIBUTES_LIST(attribute_id,
vendor_id))->attribute_name;

}

private:
static set<_ATTRIBUTES_LIST> attributesList;

void populateAttributesInformation(Query *attributesQuery, const bool
*debugMode)
{
attributesQuery->reset();
*attributesQuery << "SELECT a.attribute_id, a.vendor_id,
v.vendor_name, a.attribute_name, a.type_id\nFROM attributes_table AS a INNER
JOIN vendors_table AS v\nON a.vendor_id = v.vendor_id\nORDER BY a.vendor_id
ASC, a.attribute_id ASC";
if (*debugMode)
{
cout << "\n\nQuerying Radius database for attributes data
and populate into memory" << endl << endl;
cout << attributesQuery->preview() << endl << endl;
}
attributesQuery->storein(attributesList);
}
};







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

Bassam A. Al-Khaffaf wrote:
> Your solution doesn't work with my case. The "attributeList" is always
fill
> with data,

Please provide a more detailed example. Ideally, it should compile and
run against the MySQL++ sample database.

We don't even know what data type attributeList is, or how it gets
filled. It's awfully hard to guess at solutions with such limited
information.

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

--
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



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




<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
ide.eclipse.wtp...    bug-tracking.ro...    xfree86.cvs/200...    lisp.wxcl.devel...    file-systems.ar...    kde.devel.kwrit...    jakarta.jetspee...    qnx.openqnx.dev...    drivers.openib/...    ports.xbox.deve...    gis.gdal.devel/...    netbsd.ports.ma...    ubuntu.marketin...    systemtap/2005-...    web.omniweb/200...    mail.qmail.ldap...    hardware.soekri...    os.netbsd.devel...    audio.madman.ge...    tv.freeguide-tv...    cluster.openmos...    education.ezpro...   
Home | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe

Navigation