Hi, I need to get the last Identity from a table that was inserted into from a Stored Pocedure.
Im trying this and it doesn work.
(IN PartName VARCHAR(256),
IN PartPrice DECIMAL(19,2),
OUT PartID BIGINT)
INSERT INTO NULLID.PARTS
(PART_NAME, PART_PRICE)
VALUES
(PartName, PartPrice);
SET PartID = IDENTITY_VAL_LOCAL();
I read a post from Serge Rielau of IBM and tried this too but this gives me invalid conversion.
SELECT PART_ID INTO PartID FROM NEW TABLE(
INSERT INTO NULLID.PARTS
(PART_NAME, PART_PRICE)
VALUES
(PartName, PartPrice));
Im migrating from SQL Server to DB2 but my expirence has not been good. I can do this with a simple RETURN SCOPE_IDENTITY() in MSSQL. Can anyone tell me what im doing wrong? THANKS!!!