Bor*_*ris 1 oracle identity auto-increment
我需要将脚本从tsql转换为plsql,例如:
DECLARE @temp_id int
INSERT INTO表(col1,col2)VALUES(1,2)
SET @temp_id = @@ identity
但是,我很难找到类似于全局变量@@ identity的东西
Oracle专家有谁?
假设您有某种触发器用序列填充主键列,并且您想获得指定的值...
INSERT INTO Table (col1, col2) VALUES (1, 2)
RETURNING pk_col INTO temp_id
/
Run Code Online (Sandbox Code Playgroud)
请注意,RETURNING语法仅适用于单行插入.
| 归档时间: |
|
| 查看次数: |
12542 次 |
| 最近记录: |