| Contents | Index |
d = fetch(k,ksql)
d = fetch(k,ksql,p1,p2,p3)
| k | Kx Systems, Inc. kdb+ connection object created with the kx function. |
| ksql | The Kx Systems, Inc. kdb+ command. |
| p1,p2,p3 | Input parameters for the ksql command. |
d = fetch(k,ksql) returns data from a Kx Systems, Inc. kdb+ database in a MATLAB structure where k is the Kx Systems, Inc. kdb+ object and ksql is the Kx kdb+ command. ksql can be any valid kdb+ command. The output of this method is any data resulting from the command specified in ksql.
d = fetch(k,ksql,p1,p2,p3) executes the command specified in ksql with one or more input parameters, and returns the data from this command.
Run the following command from a DOS prompt to specify the port number 5001:
q tradedata.q -p 5001
Connect to a Kx Systems, Inc. server using IP address LOCALHOST and port number 5001:
k = kx('localhost',5001);
Retrieve data using the command select from trade:
d = fetch(k,'select from trade');
d =
sec: {5000x1 cell}
price: [5000x1 double]
volume: [5000x1 int32]
exchange: [5000x1 double]
date: [5000x1 double]
Retrieve data, passing an input parameter 'ACME' to the command select from trade:
d = fetch(k,'totalvolume','ACME');
d =
volume: [1253x1 int32] This is the total trading volume for the security ACME in the table trade. The function totalvolume is defined in the sample Kx Systems, Inc. kdb+ file, tradedata.q.
View demos and recorded presentations led by industry experts.
Now On Demand
Network with industry peers and learn the latest applications of the leading software product for computational finance.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |