01-22-2015 04:00 AM
Hello,
I have written simple procedure that works good when I run it from workbench but doesn't work from labview. I want to insert some data and get primary key of inserted id:
CREATE DEFINER=`root`@`localhost` PROCEDURE `new_procedure`(
IN emp_id_val int,
IN project_id_val int,
IN work_mode_val int)
BEGIN
insert into work_managment.sessions (emp_id,project_id,work_mode)
values (11,1,1);
SELECT LAST_INSERT_ID();
END
and why that doesn't work when I call it from labview?
when i replace last inserted id with:
select max(session_id) as session from work_managment.sessions;
it works good in labview
What could be the problem??
01-29-2015 04:51 AM - edited 01-29-2015 04:51 AM
Dear Pawel,
From what I see, the problem could be that the table reference for LAST_INSERT might not be stored properly. Could you send me the LabVIEW code that produces the error? If it is reproducible, I can forward the issue to the developers.
In the meantime you can use the SELECT MAX() command as you have done.
Regards:
02-01-2015 08:28 PM