Details
-
New Feature
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
None
-
None
Description
Hi
Is it possible to implement Oracle's syntax for
INSERT INTO <TABLE> VALUES <VALUES> RETURNING <FIELDS> INTO <HOST_VARIABLES> |
?
It would be nice to be able to do the following inside a stored procedure:
create or replace table party ( |
id_party bigint unsigned not null, |
field1 char, |
field2 char, |
field3 char |
primary key (id_party)) |
engine = innodb;
|
|
create or replace sequence seq_id_party start by 1 increment by 1; |
|
delimiter $$
|
|
create or replace procedure create_party(inout io_reg_party row type of party) |
begin
|
-- Validate io_reg_party's input fields. |
|
insert into party ( |
id_party,
|
field1,
|
field2,
|
field3)
|
values ( |
next value for seq_id_party, |
io_reg_party.field1,
|
io_reg_party.field2,
|
io_reg_party.field3)
|
returning
|
id_party
|
into |
io_reg_party.id_party;
|
end
|
$$
|
|
delimiter ;
|
|
Regards.
Attachments
Issue Links
- is duplicated by
-
MDEV-36242 INSERT ... RETURNING <column> INTO <variable>
-
- Closed
-
-
MDEV-36778 Support RETURNING .. INTO
-
- Closed
-
- relates to
-
MDEV-8307 Allow DELETE FROM RETURNING to be used with INSERT INTO
-
- Open
-