Skip to content

Frequently-asked questions from the k4 listbox

If you notice a question that is asked more then once on the k4 list, please feel free to add it here.

Where can I find archives of the k4 list?

Archives are available to subscribers at the Topicbox. When you follow that link, you will be asked for your e-mail address and the mailing list name. Use k4 for the list name, and the e-mail address that you used to subscribe to the k4 list.

How to post test data on the k4 list?



You can generate an executable form of your data using 0N!.


Note use of ; to suppress the default display. If you use the latter form, prefix it with k) in your post, so that others could easily cut and paste it in their q session.

a b c
4 6 4
3 1 7
7 7 5
1 9 0
1 8 9

What are the limits on the number of variables in q functions?

Reference: Lambdas

What does 'error mean?

Basics: Errors

Why does sg work with :: but not :? Also why does {x.time} not work?


How do I query a column of strings for multiple values?

If you wish to query a column of strings for a single value either like or ~ (Match) with an iterator can be used

q)select from e where c like "ams"
q)select from e where c like "am*"

To query for multiple strings you need to use another iterator, then aggregate the results into a single boolean value using sum or any. Generally the like form is easier to understand and more efficient.


How to kill long/invalid query on a server?


$ kill -INT <pid>

You can find the server process ID by examining .z.i.

How do I recall and edit keyboard input?

Start q under rlwrap to get readline support, e.g.

$ rlwrap l64/q -p 5001

This is available in most Linux repositories.

An alternative to rlwrap is tecla's enhance. This is good for vi-mode users who would like more of vi’s keys functionality – eg d f x will delete everything up to the next x and you can paste it back, too.