generate id read from database
11 views (last 30 days)
Show older comments
[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 Comments
Answers (0)
See Also
Categories
Find more on Reporting and Database Access in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!