2 messages in com.mysql.lists.plusplusRe: Table() returns null
FromSent OnAttachments
David Sevier27 Sep 2007 10:00 
Warren Young27 Sep 2007 20:01 
Subject:Re: Table() returns null
From:Warren Young (mysq@etr-usa.com)
Date:09/27/2007 08:01:26 PM
List:com.mysql.lists.plusplus

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