English 中文(简体)
How do I save a program in kdb/q?
原标题:
  • 时间:2011-10-25 08:34:53
  •  标签:
  • kdb

Most of the examples seem to be run in REPL mode. Is it possible to load myprog.q from disk?

最佳回答

Sure, you just need to provide the name of the .q script as an argument to the q process:

/opt/app/KX/q2.7/q /opt/app/path/to/script/myprog.q -p 5000

would start a q process on port 5000. On startup it will execute the contents of your script.

问题回答

Alternatively, from inside a running REPL,

l myprog.q

will load the script.

Also note that you can persist the root workspace to disk and resume later:

$ q
q)a:1
q)`:workspace set get`.
`:workspace
q)\
$ q workspace
q)a
1




相关问题
Concat string with number in kdb+ q

I can append a string with number. temp:30 text:"Current temperature is ",string temp show text type text Result "Current temperature is 30" 10h However, if I append one more ...

How do I save a program in kdb/q?

Most of the examples seem to be run in REPL mode. Is it possible to load myprog.q from disk?

Q (kdb): nested where query

What are the ways to in Q to use the results of a nested query in a where clause? I m looking for something similar to SQL statement. select from food where type_id in ( select type_id from ...

Passing db path to l or .Q.l using a variable

I m writing a q script that loads a db in a particular path and does some processing on it. The location of the db is currently hardcoded in the script, but I want to pass the db path as an argument ...

How to convert tic data to 5 minute OHLC?

I am learning KDB+ and have loaded the tic data into the table W as below. My question is, how to transfer the data into 5 (or n) minutes OHLCVA? "Stk_ID","Date","Time","Price","Chg","Vol","Amt","Ty" ...

KDB Find first date with data in each table of a process

I am trying to find first date where we have data available per process over IPC. I tried below but it isn t efficient. Is there a better way to find this? select min date from ({select date from x ...

热门标签