以下是plpgsql函数的一部分.问题是,结果source_geom并target_geom是character varying数据类型,因此我需要两个环绕source_geom,并target_geom在引号("").问题是在plpgsql语言中我怎么不知道我能做到.
这就是我现在所拥有的:
EXECUTE 'update ' || quote_ident(geom_table) ||
' SET source = ' || source_geom ||
', target = ' || target_geom ||
' WHERE ' || quote_ident(gid_cname) || ' = ' || _r.id;
Run Code Online (Sandbox Code Playgroud)
我遇到的错误如下:
ERROR: syntax error at or near "C03B9E3B66052D400DDEFC2BD0F24140"
LINE 1: ...pdate track_points SET source = 0101000020E6100000C03B9E3B66...
^
QUERY: update track_points SET source = 0101000020E6100000C03B9E3B66052D400DDEFC2BD0F24140, target = 0101000020E610000075690DEF83052D40F88E75CCD4F24140 WHERE ogc_fid = 2
CONTEXT: PL/pgSQL function "create_network" …Run Code Online (Sandbox Code Playgroud)