Subject error in execute statement into with generator id
Author intellekta
Hello, i got

"Unsuccessful execution caused by an unavailable resource.
Variable type (position 0) in EXECUTE STATEMENT 'SELECT
GEN_ID(GEN_CONTENT_ID,1) FROM RDB$DATABASE' INTO does not match returne."

the generator GEN_CONTENT_ID works and increments its value ervery call.

Thanks in advance

CREATE PROCEDURE NEWTABLEID (TABLENAME VARCHAR(50))
RETURNS (NEWID BIGINT)
AS
BEGIN
TMPSQL = 'SELECT GEN_ID(GEN_' || TABLENAME || '_ID,1) FROM RDB$DATABASE';
EXECUTE STATEMENT TMPSQL INTO :NEWID;
END