Re: [sqlite] I still think it's a bug, 0 rows, no fieldnames
Just tested, seems to work :) Thanks! - Original Message - From: "Nuno Lucas" <[EMAIL PROTECTED]> To: Sent: Monday, July 25, 2005 10:38 AM Subject: Re: [sqlite] I still think it's a bug, 0 rows, no fieldnames I'm not understanding what's the problem here. I always get the column names even on empty result sets (so I can show them in a grid header). I confess I haven't been using the latest sqlite versions to be sure it is still returned, but isn't this what you want? My guess is that maybe you are using the callback API, that need "PRAGMA empty_result_callbacks = 1" to return the columns on empty result sets, but I haven't used that API for a long time. Regards, ~Nuno Lucas [25-07-2005 9:08, Edwin Knoppert escreveu] I might be mistaken but you should never expect row-0 for data. What i meant is that the fieldnames are present when there is data. And not when there is no data. In either case, row-0 should never be threated as data row. So one can not expect data in there. The point is when there is data, SQLite returns the fieldnames from a (joined) query. For what reason it should not return the names when there was no data? (And not having an error of course) I'm pretty certain this is only a technical matter, not a logical one. schema table? I'm not familiar with that, i don't think it is realted to fields from join-ed queries. This question has not much to do with my earlier post, i know how to obtain the fields properly.
Re: [sqlite] I still think it's a bug, 0 rows, no fieldnames
That's good news! Thanks, will try. :) - Original Message - From: "Nuno Lucas" <[EMAIL PROTECTED]> To: Sent: Monday, July 25, 2005 10:38 AM Subject: Re: [sqlite] I still think it's a bug, 0 rows, no fieldnames I'm not understanding what's the problem here. I always get the column names even on empty result sets (so I can show them in a grid header). I confess I haven't been using the latest sqlite versions to be sure it is still returned, but isn't this what you want? My guess is that maybe you are using the callback API, that need "PRAGMA empty_result_callbacks = 1" to return the columns on empty result sets, but I haven't used that API for a long time. Regards, ~Nuno Lucas [25-07-2005 9:08, Edwin Knoppert escreveu] I might be mistaken but you should never expect row-0 for data. What i meant is that the fieldnames are present when there is data. And not when there is no data. In either case, row-0 should never be threated as data row. So one can not expect data in there. The point is when there is data, SQLite returns the fieldnames from a (joined) query. For what reason it should not return the names when there was no data? (And not having an error of course) I'm pretty certain this is only a technical matter, not a logical one. schema table? I'm not familiar with that, i don't think it is realted to fields from join-ed queries. This question has not much to do with my earlier post, i know how to obtain the fields properly.
Re: [sqlite] I still think it's a bug, 0 rows, no fieldnames
I'm not understanding what's the problem here. I always get the column names even on empty result sets (so I can show them in a grid header). I confess I haven't been using the latest sqlite versions to be sure it is still returned, but isn't this what you want? My guess is that maybe you are using the callback API, that need "PRAGMA empty_result_callbacks = 1" to return the columns on empty result sets, but I haven't used that API for a long time. Regards, ~Nuno Lucas [25-07-2005 9:08, Edwin Knoppert escreveu] I might be mistaken but you should never expect row-0 for data. What i meant is that the fieldnames are present when there is data. And not when there is no data. In either case, row-0 should never be threated as data row. So one can not expect data in there. The point is when there is data, SQLite returns the fieldnames from a (joined) query. For what reason it should not return the names when there was no data? (And not having an error of course) I'm pretty certain this is only a technical matter, not a logical one. schema table? I'm not familiar with that, i don't think it is realted to fields from join-ed queries. This question has not much to do with my earlier post, i know how to obtain the fields properly.
Re: [sqlite] I still think it's a bug, 0 rows, no fieldnames
I might be mistaken but you should never expect row-0 for data. What i meant is that the fieldnames are present when there is data. And not when there is no data. In either case, row-0 should never be threated as data row. So one can not expect data in there. The point is when there is data, SQLite returns the fieldnames from a (joined) query. For what reason it should not return the names when there was no data? (And not having an error of course) I'm pretty certain this is only a technical matter, not a logical one. schema table? I'm not familiar with that, i don't think it is realted to fields from join-ed queries. This question has not much to do with my earlier post, i know how to obtain the fields properly. - Original Message - From: "Charlie Clark" <[EMAIL PROTECTED]> To: Sent: Sunday, July 24, 2005 4:26 PM Subject: Re: [sqlite] I still think it's a bug, 0 rows, no fieldnames On 2005-07-24 at 16:11:26 [+0200], Edwin Knoppert <[EMAIL PROTECTED]> wrote: Why defending it? It's prob. a simple issue. Besides, why i want the names, why should a system need to parse a query? You approach this way to 'static' imo (what you enter is your result). You can easily say to also remove the fieldnames when we *have* data. An 0-row containing the relational variables is a *special* case and non-relational and causes problems for results which do not expect the names of the values to be included in the result set. .schema(table) gives you all you need. Charlie
Re: [sqlite] I still think it's a bug, 0 rows, no fieldnames
On 2005-07-24 at 16:11:26 [+0200], Edwin Knoppert <[EMAIL PROTECTED]> wrote: > Why defending it? > It's prob. a simple issue. > Besides, why i want the names, why should a system need to parse a query? > You approach this way to 'static' imo (what you enter is your result). > You can easily say to also remove the fieldnames when we *have* data. An 0-row containing the relational variables is a *special* case and non-relational and causes problems for results which do not expect the names of the values to be included in the result set. .schema(table) gives you all you need. Charlie
Re: [sqlite] I still think it's a bug, 0 rows, no fieldnames
Why defending it? It's prob. a simple issue. Besides, why i want the names, why should a system need to parse a query? You approach this way to 'static' imo (what you enter is your result). You can easily say to also remove the fieldnames when we *have* data. - Original Message - From: "Puneet Kishor" <[EMAIL PROTECTED]> To: Sent: Sunday, July 24, 2005 3:40 PM Subject: Re: [sqlite] I still think it's a bug, 0 rows, no fieldnames On Jul 24, 2005, at 6:52 AM, Edwin Knoppert wrote: I would recommend the SQLite engine keeps returning the 0-row having the fields from the result query (select) It does not seem to do that when there was no data returned. At the end my goal would be to enumerate the fieldnames + it's tablename. As far is i know, msaccess does this. your question is very confusing, at least to me. It seems that you want to get the names of the table and the columns even when no rows are returned. But you already know the names of the table and the columns otherwise you wouldn't have been able to make the query in the first place! MS-Access is a strange beast, and not the best of examples to use as a benchmark for SQLite. MS-Access is designed for desktop use by end-users, and as such, it happily violates a fair number of standards all the while concentrating on making things easy for the end-user (on which, the jury is mixed). SQLite is a server. Its focus would be on sticking to the standards as much as possible while delivering the results as fast as possible. Now, it is up to the user (not the end-user) to create a program based on SQLite that may or may not be as friendly as MS-Access to the end-user. Would it be fair for me to say, "I still think it is a bug that MS-Access doesn't run on my Mac!"? -- Puneet Kishor
Re: [sqlite] I still think it's a bug, 0 rows, no fieldnames
On Jul 24, 2005, at 6:52 AM, Edwin Knoppert wrote: I would recommend the SQLite engine keeps returning the 0-row having the fields from the result query (select) It does not seem to do that when there was no data returned. At the end my goal would be to enumerate the fieldnames + it's tablename. As far is i know, msaccess does this. your question is very confusing, at least to me. It seems that you want to get the names of the table and the columns even when no rows are returned. But you already know the names of the table and the columns otherwise you wouldn't have been able to make the query in the first place! MS-Access is a strange beast, and not the best of examples to use as a benchmark for SQLite. MS-Access is designed for desktop use by end-users, and as such, it happily violates a fair number of standards all the while concentrating on making things easy for the end-user (on which, the jury is mixed). SQLite is a server. Its focus would be on sticking to the standards as much as possible while delivering the results as fast as possible. Now, it is up to the user (not the end-user) to create a program based on SQLite that may or may not be as friendly as MS-Access to the end-user. Would it be fair for me to say, "I still think it is a bug that MS-Access doesn't run on my Mac!"? -- Puneet Kishor
[sqlite] I still think it's a bug, 0 rows, no fieldnames
I would recommend the SQLite engine keeps returning the 0-row having the fields from the result query (select) It does not seem to do that when there was no data returned. At the end my goal would be to enumerate the fieldnames + it's tablename. As far is i know, msaccess does this. Am i wrong? Thanks!