generate id read from database

10 次查看(过去 30 天)
Siti Maisarah
Siti Maisarah 2011-6-12
[EDIT: 20110612 11:27 CDT - merge from duplicate - WDR]
Hi. I want to generate id in gui. This id will be saved in the mysql database. I use this coding, but the code only can display the last id in database, but not generated a new id..
processid = ('select process_id from process WHERE process_id = @@IDENTITY');
curs = exec(conn, processid);
curs = fetch(curs);
last_process_id = curs.Data{end};
set(handles.edit11,'string',last_process_id);
when I run the gui, the textbox display the last id in the process table, which is P001, it supposed to display P002.
[Material from duplicate question]
Hi. I want to generate id in gui. This id will be saved in the mysql database. I use this coding, but the code only can display the last id in database, but not generated a new id..
processid = ('select process_id from process WHERE process_id = @@IDENTITY');
curs = exec(conn, processid);
curs = fetch(curs);
last_process_id = curs.Data{end};
set(handles.edit11,'string',last_process_id);
when I run the gui, the textbox display the last id in the process table, which is P001, it supposed to display P002.

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Reporting and Database Access 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by