Database function gives error - Postgresql
I had some help here and got the following code:
-- Setup Solrid Function
CREATE OR REPLACE FUNCTION solrid(IN local_id INTEGER, OUT result TEXT) AS $$
DECLARE
database_id TEXT := 'A';
BEGIN
result := database_id || local_id::TEXT;
END;
$$ LANGUAGE PLPGSQL;
However, when I run it in sqlfiddle it says:
Failed to create schema: ERROR: Inexhaustible quoted string in dollars or so "$$ DECLARE database_id TEXT: = 'A'":
This error may seem pretty self-explanatory, but I can't figure out how to fix it. Can anyone shed some light on this please?
+3
source to share