blob: de6620da408c3639c5bf292629cc50b150bb1244 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
CREATE OR REPLACE FUNCTION insert_turn (
integer, -- testid
time, -- elapsedtime
integer, -- holeposition
integer -- blockid
) RETURNS integer AS $$
DECLARE
par_testid ALIAS FOR $1;
par_elapsedtime ALIAS FOR $2;
par_holeposition ALIAS FOR $3;
par_blockid ALIAS FOR $4;
var_turnid integer;
BEGIN
INSERT INTO tbl_turn (
testid,
elapsedtime,
holeposition,
blockid
) VALUES (
par_testid,
par_elapsedtime,
par_holeposition,
par_blockid
);
SELECT INTO var_turnid seq_turn.last_value;
RETURN var_turnid;
END;
$$ LANGUAGE plpgsql;
|