Short answer: meta tablename

For example –

q)\l sp.q        / found in $QHOME/sp.q
s | name  status city
--| -------------------
s1| smith 20     london
s2| jones 10     paris
s3| blake 30     paris
s4| clark 20     london
s5| adams 30     athens
q)meta s
c     | t f a
------| -----
s     | s
name  | s
status| i
city  | s

The output of meta is a kdb table, where columns c and t indicate the column name and data type, respectively.

The key the provides an alternate method:

q)key exec city from s

If you need the type code, use the type function:

q)type exec city from s

See also: Type character definitions, Meta output faq.

The content of the table is split across n segments. For example, par.txt specifies 3 segments below and slices a table named vltablename by symbol into 3 segments.

For example:

$ cat /vol/db/par.txt

$ ls /vol/disk*/segment/2011.03.07/vltable
/vol/disk1/segment/2011.03.07/vltable # sym A-I
/vol/disk2/segment/2011.03.07/vltable # sym J-R
/vol/disk3/segment/2011.03.07/vltable # sym R-Z

Note that the typical `p# attribute of column sym will be missing in the query result. Remember to re-apply the attribute prior to use.

See also: .Q.u, and .Q.par