Re: [sqlite] pragma table_info return column delimiters?
On 2018/01/03 12:15 PM, Bart Smissaert wrote: Is there a way with pragma table_info or otherwise (other than parsing the table create statement from SQLite_master) to get the column names including the column delimiters, eg double quotes or square brackets? So I would get eg: [column1] [column2] etc. if indeed the column names were delimited like that. Don't think so, those are meta, it's like asking if there is a way to tell from the compiled program what the comments in the code was that the programmer inserted when coding... The compiler very correctly discards it and no trace of it exists in the compiled program. I have made a few parsers for the SQLite schemata and also you can probably copy paste some code for it directly from the SQLite source, but may I ask why you would need that information? (Perhaps the problem can be solved another way) ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] pragma table_info return column delimiters?
OK, thanks. I am getting the information now from the create table statements and sofar that seems to work OK. Just wanted to make sure there wasn't a better way to handle this. RBS On Wed, Jan 3, 2018 at 11:08 AM, Richard Hippwrote: > On 1/3/18, Bart Smissaert wrote: > > Is there a way with pragma table_info or otherwise (other than parsing > the > > table create statement from SQLite_master) to get the column names > > including the column delimiters, eg double quotes or square brackets? So > I > > would get eg: [column1] [column2] etc. if indeed the column names were > > delimited like that. > > No. SQLite does not retain that information in its internal symbol > tables. You'll have to parse out the original CREATE TABLE statements > to figure that out. > -- > D. Richard Hipp > d...@sqlite.org > ___ > sqlite-users mailing list > sqlite-users@mailinglists.sqlite.org > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users > ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] pragma table_info return column delimiters?
On 2018/01/03 12:15 PM, Bart Smissaert wrote: Is there a way with pragma table_info or otherwise (other than parsing the table create statement from SQLite_master) to get the column names including the column delimiters, eg double quotes or square brackets? So I would get eg: [column1] [column2] etc. if indeed the column names were delimited like that. Don't think so, those are meta, it's like asking if there is a way to tell from the compiled program what the comments in the code was that the programmer inserted when coding... The compiler very correctly discards it and no trace of it exists in the compiled program. I have made a few parsers for the SQLite schemata and also you can probably copy paste some code for it directly from the SQLite source, but may I ask why you would need that information? (Perhaps the problem can be solved another way) (Accidentally sent this on another mail first, so if it comes through twice, my apologies...) ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] pragma table_info return column delimiters?
delimiters delimit, so they are not part of the context.. such information aobut delimiters is never saved... since they havce done their job delimiiting already. Why do you want this? On Wed, Jan 3, 2018 at 2:50 AM, Bart Smissaertwrote: > > What are column delimiters? > > create table [table1)([ID] integer, [text_field] text) > > I am talking about the square brackets here surrounding the field names. > Sorry, used the wrong word in saying delimiters. > > RBS > > On Wed, Jan 3, 2018 at 10:44 AM, Luuk wrote: > > > > > > > On 03-01-18 11:15, Bart Smissaert wrote: > > > Is there a way with pragma table_info or otherwise (other than parsing > > the > > > table create statement from SQLite_master) to get the column names > > > including the column delimiters, eg double quotes or square brackets? > So > > I > > > would get eg: [column1] [column2] etc. if indeed the column names were > > > delimited like that. > > > > > > RBS > > > > > What are column delimiters? > > > > |sqlite> select * from test; > > a, b, c > > 1, 2, drie > > 4, 5, zes > > sqlite> select a,b,c from test; > > a, b, c > > 1, 2, drie > > 4, 5, zes > > sqlite> select [a],[b],[c] from test; > > a, b, c > > 1, 2, drie > > 4, 5, zes > > sqlite> select "a","b","c" from test; > > a, b, c > > 1, 2, drie > > 4, 5, zes > > > > Of course, you shoul not use single quotes ;) > > sqlite> select 'a','b','c' from test; > > 'a', 'b', 'c' > > a, b, c > > a, b, c > > sqlite>| > > ___ > > sqlite-users mailing list > > sqlite-users@mailinglists.sqlite.org > > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users > > > ___ > sqlite-users mailing list > sqlite-users@mailinglists.sqlite.org > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users > ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] pragma table_info return column delimiters?
On 1/3/18, Bart Smissaertwrote: > Is there a way with pragma table_info or otherwise (other than parsing the > table create statement from SQLite_master) to get the column names > including the column delimiters, eg double quotes or square brackets? So I > would get eg: [column1] [column2] etc. if indeed the column names were > delimited like that. No. SQLite does not retain that information in its internal symbol tables. You'll have to parse out the original CREATE TABLE statements to figure that out. -- D. Richard Hipp d...@sqlite.org ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] pragma table_info return column delimiters?
> What are column delimiters? create table [table1)([ID] integer, [text_field] text) I am talking about the square brackets here surrounding the field names. Sorry, used the wrong word in saying delimiters. RBS On Wed, Jan 3, 2018 at 10:44 AM, Luukwrote: > > > On 03-01-18 11:15, Bart Smissaert wrote: > > Is there a way with pragma table_info or otherwise (other than parsing > the > > table create statement from SQLite_master) to get the column names > > including the column delimiters, eg double quotes or square brackets? So > I > > would get eg: [column1] [column2] etc. if indeed the column names were > > delimited like that. > > > > RBS > > > What are column delimiters? > > |sqlite> select * from test; > a, b, c > 1, 2, drie > 4, 5, zes > sqlite> select a,b,c from test; > a, b, c > 1, 2, drie > 4, 5, zes > sqlite> select [a],[b],[c] from test; > a, b, c > 1, 2, drie > 4, 5, zes > sqlite> select "a","b","c" from test; > a, b, c > 1, 2, drie > 4, 5, zes > > Of course, you shoul not use single quotes ;) > sqlite> select 'a','b','c' from test; > 'a', 'b', 'c' > a, b, c > a, b, c > sqlite>| > ___ > sqlite-users mailing list > sqlite-users@mailinglists.sqlite.org > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users > ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] pragma table_info return column delimiters?
On 03-01-18 11:15, Bart Smissaert wrote: > Is there a way with pragma table_info or otherwise (other than parsing the > table create statement from SQLite_master) to get the column names > including the column delimiters, eg double quotes or square brackets? So I > would get eg: [column1] [column2] etc. if indeed the column names were > delimited like that. > > RBS > What are column delimiters? |sqlite> select * from test; a, b, c 1, 2, drie 4, 5, zes sqlite> select a,b,c from test; a, b, c 1, 2, drie 4, 5, zes sqlite> select [a],[b],[c] from test; a, b, c 1, 2, drie 4, 5, zes sqlite> select "a","b","c" from test; a, b, c 1, 2, drie 4, 5, zes Of course, you shoul not use single quotes ;) sqlite> select 'a','b','c' from test; 'a', 'b', 'c' a, b, c a, b, c sqlite>| ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] pragma table_info return column delimiters?
Is there a way with pragma table_info or otherwise (other than parsing the table create statement from SQLite_master) to get the column names including the column delimiters, eg double quotes or square brackets? So I would get eg: [column1] [column2] etc. if indeed the column names were delimited like that. RBS ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users