SET ":inner" = CASE COALESCE($rowid, '') <> '' WHEN TRUE THEN 'sqlpage/save.sql' ELSE CASE COALESCE(:hash, '') WHEN '' THEN 'sqlpage/Link.sql' ELSE 'sqlpage/link.sql' END END; SELECT 'dynamic' AS component, sqlpage.run_sql(:inner) AS properties;