Subject | How I can know wich is the value generated? |
---|---|
Author | W O |
Post date | 2011-03-10T18:04:37Z |
Hello everybody
I have a trigger like this:
SET TERM ^ ;
CREATE TRIGGER MOVIM_BI FOR MOVIMCAB
ACTIVE BEFORE INSERT
POSITION 0
AS
BEGIN
IF (NEW.MVC_IDENTI IS NULL OR NEW.MVC_IDENTI = 0) THEN
NEW.MVC_IDENTI = GEN_ID(GEN_MOVIM, 1);
END^
SET TERM ; ^
and it works fine, no problem. Besides it, I have a Stored Procedure like
this:
SET TERM ^ ;
CREATE PROCEDURE SAVE_HEADER (
IDENTI TYPE OF D_IDENTIFICATOR,
AS
BEGIN
UPDATE OR INSERT INTO MOVIMCAB
(MVC_IDENTI)
VALUES (:IDENTI);
END^
SET TERM ; ^
And it works fine, too. Now, my question is: How I can know which is the
value of the column MVC_IDENTI? Is it 5, is it 12, is it 26? I need that
value to be returned to my application because it will be used later in my
child table. The same value that have MVC_IDENTI I need to store in the
child table.
Thanks in advance.
Walter.
[Non-text portions of this message have been removed]
I have a trigger like this:
SET TERM ^ ;
CREATE TRIGGER MOVIM_BI FOR MOVIMCAB
ACTIVE BEFORE INSERT
POSITION 0
AS
BEGIN
IF (NEW.MVC_IDENTI IS NULL OR NEW.MVC_IDENTI = 0) THEN
NEW.MVC_IDENTI = GEN_ID(GEN_MOVIM, 1);
END^
SET TERM ; ^
and it works fine, no problem. Besides it, I have a Stored Procedure like
this:
SET TERM ^ ;
CREATE PROCEDURE SAVE_HEADER (
IDENTI TYPE OF D_IDENTIFICATOR,
AS
BEGIN
UPDATE OR INSERT INTO MOVIMCAB
(MVC_IDENTI)
VALUES (:IDENTI);
END^
SET TERM ; ^
And it works fine, too. Now, my question is: How I can know which is the
value of the column MVC_IDENTI? Is it 5, is it 12, is it 26? I need that
value to be returned to my application because it will be used later in my
child table. The same value that have MVC_IDENTI I need to store in the
child table.
Thanks in advance.
Walter.
[Non-text portions of this message have been removed]