« How can I measure the performance of my q code? | Main | Can a table be partitioned but not be splayed? »

How do I declare a table column of type string (not symbol!)?

Declare it without a type as follows:

q)t: ([] str: ())
q)meta t
c  | t f a
---| -----

A the type of a column defined as () is determined when the first row is inserted:

q)`t insert enlist enlist "foo"
q)meta t
c  | t f a
---| -----
str| C    

Beware: if the column is emptied, it loses its type. See this related faq.

PrintView Printer Friendly Version

EmailEmail Article to Friend

Reader Comments

There are no comments for this journal entry. To create a new comment, use the form below.

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
All HTML will be escaped. Textile formatting is allowed.