Some questions using database toolbox + mysql

I have some questions about Database Toolbox. Using MySql.
  1. There is a problem with Russian codepage and all symbols in are replaced by '?'.
  2. It's hard to make big queries in MATLAB, problems for example like '%user'

 Akzeptierte Antwort

the cyclist
the cyclist am 13 Feb. 2011

0 Stimmen

(1) I think I would contact MATLAB support directly for this. I think you will find few users here with a combination of Russian and database toolbox experience!
(2) I am not sure what you mean here. Do you mean that the queries themselves are many characters long, or that they return many rows? I have no problem with either of these in MATLAB, but I do have some suggestions in both case.
(2a) If the queries are just long, I suggest building them in the following way:
>> queryText = '';
>> queryText = [queryText, 'select * from table1 t1 '];
>> queryText = [queryText, 'join table2 t2 on t.id=t2.other_id '];
>> queryText = [queryText, 'where <condition 1> '];
>> queryText = [queryText, 'and <condition 2> '];
>> ...... etc .....
>> queryText = [queryText, 'order by t1.id '];
and then execute the query using that queryText variable. I find that much more manageable than using continuation characters to make very long lines.
(2b) If your query is returning many rows, and that is a problem, you may find that setting the number of row that are pre-fetched may help. For example,
>> setdbprefs('DefaultRowPreFetch','100')

1 Kommentar

Santosh Kasula
Santosh Kasula am 14 Feb. 2011
M'abuse says: (2a) That's it) Testing) Thank you. How to set codepage in matlab (need UTF-8).

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Produkte

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by