KX Community

Find answers, ask questions, and connect with our KX Community around the world.
KX Community Guidelines

Home Forums kdb+ Changing column type fails Re: Changing column type fails

  • gyorokpeter-kx

    Member
    February 28, 2023 at 12:00 am

    Can you make sure that the res variable you do the meta on is the same that you are trying to update? E.g. global vs local variable, or other queries changing it in the meantime. Or there being a space in the column name (possible if parsing from CSV).

    This works:

    q)res:([]id:("AA";"BB");first_name:("CC";"DD");last_name:("EE";"FF");email:("GG";"HH")) 
    q)meta res 
    c         | t f a 
    ----------| ----- 
    id        | C 
    first_name| C 
    last_name | C 
    email     | C 
    
    q)update "S"$id from res 
    id first_name last_name email 
    ----------------------------- 
    AA "CC" "EE" "GG" 
    BB "DD" "FF" "HH"