Error on SQL Statement at Matlab, importing from MS SQL Server
Mostrar comentarios más antiguos
Hi! can you help me out on this. I'm importing data from MS SQL Server. I'm using 'datastore' function plus SQL Queries/Statements. But the SQL statements I made is getting an error once I run it. Can you help me on this? Below are my codes. Kindly point out too if there is something wrong with my codes. Thanks.
conn = database.ODBCConnection('IVolatility','',''); sqlquery = 'select'... 'convert(varchar(50),fp.t_date,101) as date'... ',und.Symbol as underlying'... ',ex.Symbol as exchange'... ',fut.Symbol as futures_symbol'... ',convert(varchar(50),fut.expiration_date,101) as futures_expiration_date'... ',fp.price_open as futures_open'... ',fp.price_high as futures_high'... ',fp.price_low as futures_low'... ',fp.price_close as futures_close'...
'from dbo.FUT_underlying und'... 'inner join dbo.FUT_futures fut on fut.Underlying_id = und.Underlying_id'... 'inner join dbo.fut_exchange ex on ex.exchange_id=und.exchange_id'... 'inner join dbo.FUT_futures_price fp on fp.futures_id = fut.Futures_id'... 'and fp.t_date between und.T_date and und.Term_date'... 'where fut.symbol = 'ES/12H.CM''... 'and und.Symbol = 'ES''
dbds = exec(conn,sqlquery); ESH12 = dbds.Data
***This is the error I'm getting on the SQL Statement;
'Error: Unexpected MATLAB expression.'
Respuestas (0)
Categorías
Más información sobre Database Toolbox en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!