Title
#users-public
w

Weibo Lei

11/09/2022, 3:34 PM
Hello, is there a way to alter the table's column data type from symbol to int or double? I checked out the docs and found nothing.
Andrey Pechkurov

Andrey Pechkurov

11/09/2022, 4:11 PM
Hi
4:11 PM
Yes, we have an instruction for that. Let me find it
w

Weibo Lei

11/09/2022, 4:19 PM
I have checked out the faq, but it looks can not convert the column from symbol to int. I tried following sql:
ALTER TABLE kline_item ADD COLUMN mkt_type INT;
UPDATE kline_item SET mkt_type = market_type;
but I get the err: inconvertible types: SYMBOL -> INT [from=, to=mkt_type]
Andrey Pechkurov

Andrey Pechkurov

11/09/2022, 4:50 PM
UPDATE kline_item SET mkt_type = cast(market_type as int);
4:50 PM
it should work as long as your symbol strings contain integer numbers
w

Weibo Lei

11/09/2022, 4:57 PM
Andrei, thank you so much.
Andrey Pechkurov

Andrey Pechkurov

11/09/2022, 4:59 PM
🤝