Reputation: 1157
I have created table as following in KDb+:
test:([doc_id:`symbol$()];doc_displayid:`symbol$();doc_created_date:`date$();doc_aacess_date:`timestamp$();is_native_exist:`boolean$();file_size:`real$())
Now I want to change the datatype of column doc_id
from symbol
to int
.
How can I alter the test table and change datatype?
Upvotes: 1
Views: 6847
Reputation: 5644
You need to convert the column to a string before you can convert it to an int:
q)update "I"$string doc_id from test
doc_id| doc_displayid doc_created_date doc_aacess_date is_native_exist file_s..
------| ---------------------------------------------------------------------..
You can verify the new type with meta
:
q)meta update "I"$string doc_id from test
c | t f a
----------------| -----
doc_id | i
doc_displayid | s
doc_created_date| d
doc_aacess_date | p
is_native_exist | b
file_size | e
Upvotes: 6