tags:

views:

13

answers:

1

I have a script that parses xml file to generate SQLite table automatically. And, the simplified command is as follows.

Table string CREATE TABLE IF NOT EXISTS benchmark (id integer primary key autoincrement,Version float, CompilationParameters_Family text, CompilationParameters_XilinxVersion text, CompilationParameters_Device text, CompilationParameters_XilinxParameterList_Parameter_OptimizationGoal text, CompilationParameters_XilinxParameterList_Parameter_PlacerEffortLevel text)

It works well, but I wonder if I can attach some aliases for the long name in a database.

Is this possible? I mean, can I have a command something like

Table string ... CompilationParameters_XilinxVersion tex >>as version<< ...

so that I can use CompilationParameters_XilinxVersion or version when retrieve the data.

+1  A: 

What you're trying to do is not possible in SQL. However, you may want to create a VIEW that simply substitutes the long column names with your short column aliases. Note that VIEWs in sqlite are read-only and therefore cannot be written to.

Daniel Vassallo