SQLite Forum

Feature Request : Get table name alias from prepared statement
Login
updated [github sqlite3_column_table_alias branch](https://github.com/d3x0r/sqlite/tree/sqlite3_column_table_alias) patch against official sqlite/sqlite github mirror.  

noticed it is currently lacking additional test scripts.


This request goes back much further, which even included patch code... 
Nov 01, 2014; [sqlite-column-table-name-and-table-alias-name (nabble)]( http://sqlite.1065341.n5.nabble.com/sqlite-column-table-name-and-table-alias-name-tt78959.html#a78979)

---

So 3 yeas ago(nearly) there was this first message I saw...

http://sqlite.1065341.n5.nabble.com/Re-sqlite-column-table-name-and-table-alias-name-td100016.html  (Jan 14, 2018)

Original message with patched code

http://sqlite.1065341.n5.nabble.com/Feat-Req-Get-Aliased-Table-Name-td101023.html#a105525  

Mar 18, 2018 suggested a patch
Jan 24, 2019 a year later... suggested a patch...
2020-03-12  another year I started this thread when the forum started

2021-01-12 maybe this is the year this feature can get implemented?

It's not like this would make sqlite be the only one in the world doing a thing, in fact it makes it so sqlite ISN'T the only one NOT able to return specified table alias.



```
			SQLColAttribute( pCollect->hstmt, col+1, SQL_DESC_BASE_TABLE_NAME, colname, 256, &len, NULL );
```

vs

```
			SQLColAttribute( pCollect->hstmt, col+1, SQL_DESC_TABLE_NAME, colname, 256, &len, NULL );
```

The first code is the only mode Sqlite is able to return... the second mode is the more basic table name, which would be the alias, if specified in the query.


This functionality has nothing to do with automatic names in queries from calculations or other nested select information...but returning the information as specified from the query.   (as http://sqlite.1065341.n5.nabble.com/Re-sqlite-column-table-name-and-table-alias-name-tp100016p100033.html  this part of the thread got off into)