how to customize the returned field name by PRAGMA

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

how to customize the returned field name by PRAGMA

chan wilson-3
Hi,

  I am using "PRAGMA table_info(table-name);" to the the schema info of a
table, but I could not customize the returned field name, such as:

  I wish "cid" to be ColumnID.

  normally we do by this:

  "SELECT cid AS ColumnID FROM (table-name);"

  but now I could not. is there anyway work out?

  THanks a lot!

_________________________________________________________________
??j?????????????????? MSN Messenger: http://messenger.msn.com/cn 

Reply | Threaded
Open this post in threaded view
|

Re: how to customize the returned field name by PRAGMA

Dennis Cote
chan wilson wrote:

> Hi,
>
> I am using "PRAGMA table_info(table-name);" to the the schema info of
> a table, but I could not customize the returned field name, such as:
>
> I wish "cid" to be ColumnID.
>
> normally we do by this:
>
> "SELECT cid AS ColumnID FROM (table-name);"
>
> but now I could not. is there anyway work out?
>
>
There is no way to alias the column names returned by pragma commands
since they are not normal SQL queries. You will have to translate the
names in your application (the code that is issuing the pragma commands).

Dennis Cote