Re: [sqlite] sqlite3_column_name with alias

2018-01-18 Thread J Decker
There is sqlite3_column_origin_name( stmt, n ) ; is that also the alias? instead of sqlite3_column_name(stmt,n ); or does there need to be sqlite3_column_original that really returns the not alias? On Mon, Jan 8, 2018 at 3:21 AM, Bart Smissaert wrote: > > As you can

Re: [sqlite] sqlite3_column_name with alias

2018-01-08 Thread Bart Smissaert
> As you can see Should read: As you said RBS On Mon, Jan 8, 2018 at 11:17 AM, Bart Smissaert wrote: > > Best is to define type on output > > Yes, looks that way. As you can see the alias can help, eg: > select max(integer_date_column) as integer_date_column > > what

Re: [sqlite] sqlite3_column_name with alias

2018-01-08 Thread Bart Smissaert
> Best is to define type on output Yes, looks that way. As you can see the alias can help, eg: select max(integer_date_column) as integer_date_column what I also added is coding to pick up the intended formatting from the alias, not from the column but by just specifying the output datatype:

Re: [sqlite] sqlite3_column_name with alias

2018-01-08 Thread R Smith
On 2018/01/08 12:00 AM, Bart Smissaert wrote: OK, I can see your point and I am sure you are right. All this has to do with the question (discussed not long ago) how one should know how the output from a statement should be handled by an application receiving the data. In my case that

Re: [sqlite] sqlite3_column_name with alias

2018-01-07 Thread Bart Smissaert
OK, I can see your point and I am sure you are right. All this has to do with the question (discussed not long ago) how one should know how the output from a statement should be handled by an application receiving the data. In my case that application is Excel. Take for example an integer. Excel

Re: [sqlite] sqlite3_column_name with alias

2018-01-07 Thread R Smith
On 2018/01/07 10:11 PM, Bart Smissaert wrote: Sure, in that case there can be no sensible column name. In the great majority of cases though the select field will be of a single table column, with or without an expression. In those cases it will be helpful to get the non alias column name. To

Re: [sqlite] sqlite3_column_name with alias

2018-01-07 Thread Bart Smissaert
Sure, in that case there can be no sensible column name. In the great majority of cases though the select field will be of a single table column, with or without an expression. In those cases it will be helpful to get the non alias column name. RBS On Sun, Jan 7, 2018 at 7:59 PM, Simon Slavin

Re: [sqlite] sqlite3_column_name with alias

2018-01-07 Thread Simon Slavin
On 7 Jan 2018, at 6:16pm, Bart Smissaert wrote: > Would it be possible somehow to get the column full name if there is a > column alias? > > For example if we have: > > select max(ID) as MaxID from table1 > > then I need to get max(ID) from the statement pointer. >

[sqlite] sqlite3_column_name with alias

2018-01-07 Thread Bart Smissaert
Would it be possible somehow to get the column full name if there is a column alias? For example if we have: select max(ID) as MaxID from table1 then I need to get max(ID) from the statement pointer. One would think that if sqlite3_column_name can get the alias name then somehow it must be

Re: [sqlite] sqlite3_column_name() issue with views

2014-02-04 Thread Richard Hipp
On Tue, Feb 4, 2014 at 11:34 AM, Stephan Beal wrote: > On Tue, Feb 4, 2014 at 2:52 AM, Richard Hipp wrote: > > > There is no "intended" behavior. > > http://www.sqlite.org/c3ref/mark/column_name.html?If+there+is+n*fied > > > i assume the broken image at

Re: [sqlite] sqlite3_column_name() issue with views

2014-02-04 Thread Stephan Beal
On Tue, Feb 4, 2014 at 2:52 AM, Richard Hipp wrote: > There is no "intended" behavior. > http://www.sqlite.org/c3ref/mark/column_name.html?If+there+is+n*fied i assume the broken image at the top of that page qualifies as "unintended behaviour" ;)

Re: [sqlite] sqlite3_column_name() issue with views

2014-02-03 Thread Richard Hipp
On Sun, Feb 2, 2014 at 12:23 PM, Charles Leifer wrote: > I was surprised to find that, depending on whether I queried a table or a > view, sqlite3_column_name would return different values for the column > name. Specifically, when the table is aliased and the columns in the

[sqlite] sqlite3_column_name() issue with views

2014-02-03 Thread Charles Leifer
I was surprised to find that, depending on whether I queried a table or a view, sqlite3_column_name would return different values for the column name. Specifically, when the table is aliased and the columns in the SELECT clause are quoted, sqlite returns an unquoted, unaliased column name, e.g. "

Re: [sqlite] sqlite3_column_name() contains quotes for views

2012-10-29 Thread Pavel Ivanov
> From: NSRT Mail account. <joecool2...@yahoo.com> > To: "sqlite-users@sqlite.org" <sqlite-users@sqlite.org> > Sent: Monday, October 29, 2012 2:33 PM > Subject: [sqlite] sqlite3_column_name() contains quotes for views > > I believe I r

Re: [sqlite] sqlite3_column_name() contains quotes for views

2012-10-29 Thread NSRT Mail account.
From: NSRT Mail account. <joecool2...@yahoo.com> To: "sqlite-users@sqlite.org" <sqlite-users@sqlite.org> Sent: Monday, October 29, 2012 2:33 PM Subject: [sqlite] sqlite3_column_name() contains quotes for views I believe I ran into a bug with

[sqlite] sqlite3_column_name() contains quotes for views

2012-10-29 Thread NSRT Mail account.
I believe I ran into a bug with SQLite, and would like to ensure the problem is not on my end. I created a simple table along with a view of it: SQLite version 3.7.14.1 2012-10-04 19:37:12 Enter ".help" for instructions Enter SQL statements terminated with a ";" sqlite> .dump PRAGMA

Re: [sqlite] sqlite3_column_name

2009-11-13 Thread Simon Slavin
On 13 Nov 2009, at 9:11pm, Kees Nuyt wrote: > SELECT rowid AS rowid, col1, col2 > FROM foo; > rowid|col1|col2 > 1|1|row1 > 2|2|row2 Heh. Neat. Also you can do things like SELECT col1 AS rowid, col1, col2 Simon. ___ sqlite-users mailing list

Re: [sqlite] sqlite3_column_name

2009-11-13 Thread P Kishor
On Fri, Nov 13, 2009 at 3:11 PM, Kees Nuyt wrote: > On Fri, 13 Nov 2009 15:07:54 +0100, Marco Bambini > wrote: > >> sqlite 3.6.19 >> >> CREATE TABLE foo (col1 INTEGER PRIMARY KEY, col2 TEXT); >> >> SELECT rowid, col1, col2 >> >> returns the following column

Re: [sqlite] sqlite3_column_name

2009-11-13 Thread Kees Nuyt
On Fri, 13 Nov 2009 15:07:54 +0100, Marco Bambini wrote: > sqlite 3.6.19 > > CREATE TABLE foo (col1 INTEGER PRIMARY KEY, col2 TEXT); > > SELECT rowid, col1, col2 > > returns the following column names with sqlite3_column_name: > col1, col1, col2 > > Is there a way to force the

Re: [sqlite] sqlite3_column_name

2009-11-13 Thread P Kishor
On Fri, Nov 13, 2009 at 8:07 AM, Marco Bambini wrote: > sqlite 3.6.19 > > CREATE TABLE foo (col1 INTEGER PRIMARY KEY, col2 TEXT); > a > SELECT rowid, col1, col2 > > returns the following column names with sqlite3_column_name: > col1, col1, col2 > > Is there a way to force the

Re: [sqlite] sqlite3_column_name

2009-11-13 Thread Bogdan Ureche
Unless the user is a paying customer. On Fri, Nov 13, 2009 at 8:37 AM, Jean-Christophe Deschamps wrote: > > > >Unfortunately I cannot modify the query... it is supplied by an user. > > Well, what about upgrading the user? > > Sorry coul'd resist ... I'm already out! > > > >

Re: [sqlite] sqlite3_column_name

2009-11-13 Thread Jean-Christophe Deschamps
>Unfortunately I cannot modify the query... it is supplied by an user. Well, what about upgrading the user? Sorry coul'd resist ... I'm already out! ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] sqlite3_column_name

2009-11-13 Thread Simon Slavin
On 13 Nov 2009, at 2:07pm, Marco Bambini wrote: > CREATE TABLE foo (col1 INTEGER PRIMARY KEY, col2 TEXT); > a > SELECT rowid, col1, col2 > > returns the following column names with sqlite3_column_name: > col1, col1, col2 > > Is there a way to force the first column name to be returned as rowid

Re: [sqlite] sqlite3_column_name

2009-11-13 Thread Marco Bambini
Unfortunately I cannot modify the query... it is supplied by an user. -- Marco Bambini http://www.sqlabs.com http://www.creolabs.com/payshield/ On Nov 13, 2009, at 3:10 PM, Virgilio Fornazin wrote: > SELECT > field as NAME > > does not work? > > On Fri, Nov 13, 2009 at 12:07, Marco

Re: [sqlite] sqlite3_column_name

2009-11-13 Thread Virgilio Fornazin
SELECT field as NAME does not work? On Fri, Nov 13, 2009 at 12:07, Marco Bambini wrote: > sqlite 3.6.19 > > CREATE TABLE foo (col1 INTEGER PRIMARY KEY, col2 TEXT); > a > SELECT rowid, col1, col2 > > returns the following column names with sqlite3_column_name: > col1, col1,

[sqlite] sqlite3_column_name

2009-11-13 Thread Marco Bambini
sqlite 3.6.19 CREATE TABLE foo (col1 INTEGER PRIMARY KEY, col2 TEXT); a SELECT rowid, col1, col2 returns the following column names with sqlite3_column_name: col1, col1, col2 Is there a way to force the first column name to be returned as rowid and not as its col1 alias? Thanks. -- Marco