Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save oliviermarin/bc3d9f7c0b5afd5e04744b561677ef63 to your computer and use it in GitHub Desktop.
Save oliviermarin/bc3d9f7c0b5afd5e04744b561677ef63 to your computer and use it in GitHub Desktop.
DECLARE
region_id integer;
BEGIN
-- Insertion de la région de la réunion
INSERT INTO t1(t1_f1, t1_f2, t1_f3, t1_f4)
VALUES ('Réunion', '04', TRUE, 1) RETURNING id INTO t1_id;
-- Insertion du département région
INSERT INTO t2(t2_f1, t2_f2, t2_f3, t1fk_t1)
VALUES ('Réunion', '974', TRUE, t1_id);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment