After reading the database function book, I still don't feel like configuring the data source and setting it.
Enhance Point-to-Function Memory and usage.
After the data source is configured
Conna = database ('cename', 'A', 'B') ----------- your data source name. The following parameters A and B are generally empty strings;
In some cases, to prevent the database from being connected to MATLAB, we can set up a time limit, that is, the logintimeout function,
Logintimeout (T). If the time is greater than T and the MATLAB cannot be connected, the connection is stopped;
Therefore, Ping (Conna) to check whether the connection is successful,
Then, you generally need to create a cursor,
Curs = exct (Conna, 'SQL') -------- the ecxt function is used to execute SQL statements. The returned cursor is used. In fact, I am not clear about these terms, so it is very rough to understand that through the exct get curs know, at this time the operation position.
After you get curs successfully,
Curs1 = fetch (curs );
Note that the two curse attributes are different. The most basic thing I remember is that the curs IN THE RIGHT brackets do not have data, curs1 can obtain the corresponding cellular information (I don't know if I can understand it ).
Therefore, curs1.data is the corresponding meta-cell information output, but curs. Data should not work. (Not tried ).
Of course, if you need to add data to the database
Insert (Conna, 'name', columaname, data) ------ it is easy to understand that data is input in certain columns of a database named name.
Of course, to ensure timely data updates, commit (Conna), think of the previous exct,
Therefore, commit (Conna) = exct (Conna, 'commit ')
At this point, the most basic thing should be that it can be imported to Matlab,
The final work is close (curs1) and close (Conna ).
Of course, there are still a lot of practical functions in this process, such as rows, cols, columename, width and other basic information, which is conducive to a variety of changes, convenient and flexible use.
PS. Today I met a new function. It's quite good. Record inputdlg.