generate id read from database
10 次查看(过去 30 天)
显示 更早的评论
[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 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Reporting and Database Access 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!