KX Community

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

Home Forums kdb+ parse tree not working for simple select Re: parse tree not working for simple select

  • mchbrn-q

    Member
    October 12, 2022 at 12:00 am

    Yeah that’s interesting. And since “a”, the select phrase, can take a parse tree, you could translate the functional simple exec

    q)?[tab;til 10;(last;`c2)] 
    19

    to the functional exec

    q)exec last c2 from tab 
    19 
    q)parse "exec last c2 from tab" 
    ? 
    `tab 
    () 
    () 
    ,(last;`c2) 
    
    q)?[tab;();();(last;`c2)] 
    19

    I can’t find any examples online of standard qSQL simple execs though? I don’t know if it exists because https://code.kx.com/q/ref/exec/#syntax doesn’t reference any phrases that allows for indexes . . .