Bmack
June 9, 2014, 8:37pm
1
Hi all,
Facing I would like to think a rather small issue when doing string inserts on keyed tables I am getting an error 'length.
Here is my table and insert.
listings:([musicid:()] sectdesc:symbol$(); item:(); descript:(); price:
float$(); msectid:`musicsect$())
insert[`listings;(`$“793692436151”; `$“Country”; enlist enlist “Red Lentil Singers”; enlist enlist “Volume of music”; `float$“6.50”; `$“050eee2862191098d1f9”)]
I have noticed this error happens for keyed tables and sometimes changing the order of tables solves the issue but this is not a good approach.
Please assist.
Regards,
Hi,
Could you maybe replicate the length error and show us?
The only error I see in your text is `float$“6.5”. This results in 54 46 53, as you are incorrectly parsing a string, is should be “F”$“6.5”…http://code.kx.com/wiki/Reference/DollarSign .
With the below it works fine.
listings:([musicid:()] sectdesc:symbol$(); item:(); descript:(); price:
float$(); msectid:`$())
insert[listings;(
793692436151; Country; enlist "Red Lentil Singers"; enlist "Volume of music"; "F"$"6.50";
050eee2862191098d1f9)]
Note: You may also want to consider upsert when working with a keyed table.
Let us know how you get on,
Cheers,
Sean