List:MySQL++« Previous MessageNext Message »
From:Warren Young Date:September 28 2007 3:01am
Subject:Re: Table() returns null
View as plain text  
David Sevier wrote:
> Query query = con.query();
> String QueryString = "select * from diagnostics";
> query << QueryString.cString();

Why are you doing this the hard way?  What's wrong with:

	query << "select * from diagnostics";


> This works for the most part. Except that I always get (Null) returned for
> the Table Name and 0 for the length of the field.

MySQL++ is just passing along what it gets from the underlying C API, 
and I don't care to investigate the reason it doesn't give you what you 
expect.  Two reasons:

1. I don't see what this would tell you that you don't already know. 
You passed the table name in the SELECT query.

2. If you need the names of tables without knowing them ahead of time, 
the correct way is shown in examples/dbinfo.cpp

See also examples/fieldinf1.cpp
Table() returns nullDavid Sevier27 Sep
  • Re: Table() returns nullWarren Young28 Sep