Subject | stored procedured with insert ... returning |
---|---|
Author | |
Post date | 2018-06-09T23:14:05Z |
When I try to create the following stored procedure I get sql error code = -206 Column unknown EMPID
SET TERM ! ;
CREATE OR ALTER PROCEDURE TEST (
ATITLE DOM_VARCHARTINY,
AFIRST_NAME DOM_VARCHARMEDIUM,
AINITIALS DOM_VARCHARTINY,
ASURNAME DOM_VARCHARMEDIUM,
AEMAIL DOM_VARCHARLARGE,
APHONE DOM_VARCHARTINY)
AS
begin
INSERT INTO Employee (title, first_name, initials, surname,
email, phone_ext)
VALUES(:ATitle, :AFirst_Name, :AInitials, :ASurname, :AEmail, :APhone)
RETURNING :EMPID;
end !
SET TERM ; !
The table does have a EMPID column defined and if I type the insert statement and execute it, it does work.