cancel
Showing results for 
Search instead for 
Did you mean: 

Re: Set string data type

Deepak
New Contributor
Correction: I need to do without inserting the record.
1 REPLY 1

effbiae
New Contributor
This came up before and I think the answer was "can't be done".

There is no type for "list of strings" in q, well, there is, but it's 0h, the same as for any list of lists.
kdb+ can only decide the type of generic columns after the first row is inserted.
but even then, there are no checks that the future inserts match the type of the first row:

q)p:([]a:`long$();c:())
q)`p insert (3;1 2)
,0
q)p
a c
-----
3 1 2
q)`p insert (3;"df")
,1
q)p
a c
-----
3 1 2
3 d f
q)`p insert (3;"dfd")
,2
q)p
a c
-------
3 1 2
3 "df"
3 "dfd"
q)meta p
c| t f a
-| -----
a| j
c| J

ta, jack