NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to set integer primary key instead of GUID for MYSQL?

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

0 Kudos
Message 1 of 2
(3,226 Views)

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?

Richard S -- National Instruments -- (former) Applications Engineer -- Data Acquisition with TestStand
0 Kudos
Message 2 of 2
(3,185 Views)