John Dempster - John Dempster

Forum Replies Created

Viewing 8 posts - 16 through 23 (of 23 total)
  • Author
  • in reply to: show tables in kdb+ #442

    \a or system “a” will list all the tables that exist on the kdb+ server.

    q)t:([] a:1 2 3)
    q)system “a”
    q)t2:([] c:4 5)
    q)system “a”

    in reply to: rank error during select x y z from table #260

    It is a bug. q has issues with default parameters and qsql queries inside function. You can see this from the code below:

    `q)t:([] a:1 2 3 4 5; b:6 7 8 9 0)
    a b

    1 6
    2 7
    3 8
    4 9
    5 0`

    One parameter works
    q){select from t where a in x}[2 3]
    a b

    2 7
    3 8`

    Two parameters fail.
    q){select from t where a in x,b in y}[2 3;6 7]

    Notice when I name the parameters the function executes successfully.
    q){[x;y] select from t where a in x,b in y}[2 3;6 7]
    a b

    2 7`

    I recommend specifying sensible names (not x/y) as much as possible.

    in reply to: 'host error setting up new kdb+ server #259

    Your license file from KX specifies what host is allowed to run KDB. The new machine has a different hostname.

    Copy the startup banner of the ‘host error kdb server process and send an email to KX with those details pasted in. They will then send you the required license file.

    in reply to: How much do Kdb+ developers make? #258

    It depends.. Despite what this post seems to suggest:
    Kdb isn’t some golden ticket, your other qualifications and skills matter. What uni did you go to? What is your degree/masters in? Do you have any financial knowledge.

    Average salary £87,500
    Average salary % change year-on-year +6.06%
    90% offered a salary of more than £50,500
    10% offered a salary of more than £119,000

    Google the job sites

    Contact some recruiters on linkedin. Ask Friends.

    in reply to: How to list all tables that exist on kdb server? #256

    To show variables that exist on the server there are a number of system or slash commands:

    q)t:([] a:1 2)
    q)s:([] b:3 4)
    q)vieww::select from t where i<1

    System or slash a to show tables.
    q)system “a”

    b is views, v is variables, f is functions

    Or key shows all objects that exist in a namespace:

    q)key `.

    • This reply was modified 11 years, 3 months ago by John Dempster.
    in reply to: vim kdb keyword syntax highlight #255

    Vim Syntax highlighting is possible. See details here for setting up kdb:

    in reply to: run q script in kdb console #254

    Either use \l or system l to load q script files.

    C:\>echo “show `helloWorld” >> hi.q

    KDB+ 2.8 2012.02.05 Copyright (C) 1993-2012 Kx Systems
    w64/ 8()core 8169MB admin box EXPIRE 2013.12.31

    q)\l hi.q
    “show `helloWorld”
    q)system “l hi.q”
    “show `helloWorld”

    Multi-line commands are tricky, I would instead use the qStudio KDB GUI that allows highlighting the text you want and executing it.

    in reply to: for loop evil, but wanted #144

    the q language does not have a for loop. Other control statements are available. e.g.

    q)i:0; while[i<3; show i; i:i+1]; show `end

    q)do[3; show i; i:i+1]; show `end

    if, else are also possible.

Viewing 8 posts - 16 through 23 (of 23 total)