exec

Run Kx Systems, Inc. kdb+ commands

Syntax

exec(k,command)
exec(k,command,p1,p2,p3)
exec(k,command,p1)
exec(k,command,p1,p2)
exec(k,command,p1,p2,p3)
exec(k,command,p1,p2,p3,sync)

Arguments

k

Kx Systems®, Inc. kdb+ connection object created with kx.

command

Kx Systems, Inc. kdb+ command issued using the Kx Systems, Inc. kdb+ connection object created with the kx function.

p1,p2,p3

Input parameters for Command.

Description

exec(k,command) executes the specified command in Kx Systems, Inc. kdb+ without waiting for a response.

exec(k,command,p1,p2,p3) executes the specified command with one or more input parameters without waiting for a response.

exec(k,command,p1) executes the given command with one input parameter without waiting for a response.

exec(k,command,p1,p2) executes the given command with two input parameters without waiting for a response.

exec(k,command,p1,p2,p3) executes the given command with three input parameters without waiting for a response.

exec(k,command,p1,p2,p3,sync) executes the given command with three input parameters synchronously and waits for a response from the database. Enter unused parameters as empty. You can enter sync as 0 (default) for asynchronous commands and as 1 for synchronous commands.

Examples

Retrieve the data in the table trade using the connection to the Kx Systems, Inc. kdb+ database, K:

k = kx('localhost',5001);

Use the exec command to sort the data in the table trade in ascending order.

exec(k,'`date xasc`trade'); 

Subsequent data requests also sort returned data in ascending order.

After running

q tradedata.q -p 5001

at the DOS prompt, the commands

k = kx('localhost',5001);
exec(k,'`DATE XASC `TRADE');

sort the data in the table trade in ascending order. Data later fetched from the table will be ordered in this manner.

See Also

| |

Was this topic helpful?