10-08-2009 11:38 AM
MYSQL - 5.0 and TestStand - 4.2
After reading many articles from Forum on various ways to implement this in MYSQL, I followed these steps:
1. Created one Table which is
CREATE ExecutionID (ID int NOT NULL + Autoincreament)
2. Created another Table whose structure is
ExecutionTable (EXEC_ID INT, Stationname varchar)
The procedure is like this -
DELIMITER $$
DROP PROCEDURE IF EXISTS `test_Database`.`insertExecutionID` $$
CREATE DEFINER=`admin`@`10.%` PROCEDURE `insertExecutionID`(OUT total INTEGER)
BEGIN
INSERT INTO `test_Database`.`ExecutionID` (`ID` ) VALUES (NULL);
SELECT MAX(ID) into total FROM ExecutionID;
END $$
DELIMITER ;
On the teststand side:
I have ExecutionTable (EXEC_ID, Stationname)
Where for the EXEC _ID column the Primary Key Type is set to "Get Value from Recordset" and the Primary Key Command Text to call insertExecutionID(@a);
After execution I see the new record inserted in database for the ExecutionID table; but nothing gets inserted in ExecutionTable.
Any idea why this is happening?
Thanks in advance,
Vidula
10-13-2009 04:10 PM
Vidula,
Can you please give me some more information about the schema of your database? I'm aware of limitations of MYSQL, but based on this information i'm not sure if we may be encountering a limitation of the database itself. Does that procedure work if you call it from the command line?