generate id read from database

11 views (last 30 days)
Siti Maisarah
Siti Maisarah on 12 Jun 2011
[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.

Answers (0)

Categories

Find more on Reporting and Database Access in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!