|
Sybernet / Supplied Functions Reference
Release 3.00 Oct 14, 2002 |
|
This function gets (and updates) the next identity value for a table.
FUNCTION GET_IDENTITY
(
OWNER VARCHAR2
, TABLE_NAME VARCHAR2
, COLUMN_NAME VARCHAR2
)
RETURN NUMBER;
| Parameter | Description |
|---|---|
owner |
The owner of this table. |
table_name |
The name of this table. |
column_name |
The name of the identity column. |
The next identity value.
The following example illustrates how to call get_identity:
CREATE OR REPLACE TRIGGER CRON_TRIGGER
BEFORE INSERT ON CRON
REFERENCING NEW AS NEW OLD AS OLD
FOR EACH ROW
DECLARE ROW_ID CRON.ROW_ID%TYPE;
BEGIN
:NEW.ROW_ID:=HTTP.GET_IDENTITY(USER,'CRON','ROW_ID');
RETURN;
END;
The following example illustrates how to seed this function:
DECLARE seed NUMBER(12);
BEGIN
seed:=HTTP.GET_IDENTITY('DELTEK','PROJ','PROJ_ID');
END;