John Dempster - John Dempster
Forum Replies Created
-
AuthorPosts
-
John DempsterMember\a or system “a” will list all the tables that exist on the kdb+ server.
q)t:([] a:1 2 3)
q)\a
,`t
q)system “a”
,`t
q)t2:([] c:4 5)
q)\a
`s#`t`t2
q)system “a”
`s#`t`t2
John DempsterMemberIt 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)
q)t
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]
‘rank
`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.
John DempsterMemberYour 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.
John DempsterMemberIt depends.. Despite what this post seems to suggest:
http://magmasystems.blogspot.com/2007/12/get-rich-quick-with-kdb.html
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.Supposedly: http://www.itjobswatch.co.uk/jobs/uk/kdb.do
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,000Google the job sites
http://www.indeed.co.uk/Kdb-jobsContact some recruiters on linkedin. Ask Friends.
John DempsterMemberTo 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)v:1
q)f:{x}
q)vieww::select from t where i<1System or slash a to show tables.
q)system “a”
`s`t
q)\a
`s`t
q)tables[]
`s`tb is views, v is variables, f is functions
q)\b
,`vieww
q)\v
`b`s`t`v
q)\f
`cls`f`regrOr key shows all objects that exist in a namespace:
q)key `.
`cls`regr`b`t`s`v`f`vieww- This reply was modified 10 years, 11 months ago by John Dempster.
John DempsterMemberVim Syntax highlighting is possible. See details here for setting up kdb:
http://www.timestored.com/kdb-guides/developer-environment
John DempsterMemberEither use \l or system l to load q script files.
C:\>echo “show `helloWorld” >> hi.q
C:\>q
KDB+ 2.8 2012.02.05 Copyright (C) 1993-2012 Kx Systems
w64/ 8()core 8169MB admin box 192.168.0.2 EXPIRE 2013.12.31q)\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.
John DempsterMemberthe 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
0
1
2
`end
q)i
3q)do[3; show i; i:i+1]; show `end
6
7
8
`end
if, else are also possible.
-
AuthorPosts