sqlread specific columns/variables from a MySQL table
Mostrar comentarios más antiguos
I want to import to Matlab one or a couple specific columns from a table that is stored in MySQL database. sqlread(conn, tablename) would import the whole table. I tried playing around with opts. it didn't work. Is there any way to make this work? Or should I try using sql query script? Thanks!
opts = databaseImportOptions(conn, tablename);
opts = setoptions(opts, 'SelectedVaraibleNames', {'wanted_column'}); % error message
5 comentarios
Jeff Miller
el 18 de En. de 2025
What was the error message? Note there is a typo in your post--"SelectedVaraibleNames" is mis-spelled. Is it mis-spelled in your code too?
Simon
el 19 de En. de 2025
Simon
el 19 de En. de 2025
Simon
el 19 de En. de 2025
Simon
el 19 de En. de 2025
Respuestas (2)
Simon
el 19 de En. de 2025
Walter Roberson
el 18 de En. de 2025
opts = setoptions(opts, 'SelectedVariableNames', {'wanted_column'});
You had 'SelectedVaraibleNames' instead of 'SelectedVariableNames'
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!