cancel
Showing results for 
Search instead for 
Did you mean: 

select from custom names columns

sieber
New Contributor
Hi,
i have a table with column names that contain function parameters (so the names contain special characters : and .)

q)table:flip(`a,`$"b:1.4")!(1 2 3;4 5 6)

how can I now select these columns?
of course "select b:1.4 from table" does not work as intended, so i thought i should use the functional form:

q)?[`table;();0b;(enlist`col)!enlist`$"b:1.4"]

but this one also doesn't work.

Are special characters in column names simply not supported or are there any other methods of using them? 

Markus

2 REPLIES 2

charlie
New Contributor II
New Contributor II
For sanity, you should remove those chars at the earliest opportunity.
e.g.

q).Q.id table
a b14
-----
1 4 
2 5 
3 6 

The specific problem here is the "." character which is used to refererence columns in other tables via a foreign key or linked columns.


http://www.firstderivatives.com/lecture_series_pp.asp?downloadflyer=q_for_Gods_June_2013
http://code.kx.com/wiki/Cookbook/LinkingColumns