sequencelastvalue(p_seqname text)

8.96. sequencelastvalue(p_seqname text)

Function Properties

Language: PLPGSQL

Return Type: bigint

sequenceLastValue(p_seqname) Utility function used in sl_seqlastvalue view to compactly get the last value from the requested sequence.

declare
	v_seq_row	record;
begin
	for v_seq_row in execute 'select last_value from ' || slon_quote_input(p_seqname)
	loop
		return v_seq_row.last_value;
	end loop;

	-- not reached
end;