Thanks Charles,

The USING did the trick

EXECUTE 'UPDATE ' || quote_ident(table_name) || ' SET FIELD= $1' USING
geometry

On Fri, Dec 3, 2010 at 2:00 PM, Charles Galpin <cgal...@lhsw.com> wrote:

> Sebastian, you might want to try something like
>
> EXECUTE 'UPDATE ' || quote_ident(table_name) || ' SET FIELD=' || CAST('''
> || CAST(geometry as text) || ''' as geometry)
>
> hth
> charles
>
> On Dec 3, 2010, at 6:59 AM, Sebastian E. Ovide wrote:
>
> > Hi All,
> >
> > I'm creating a PLPGSQL which has 2 parameters: a geometry and a table
> name.
> >
> > The query is something like UPDATE table_name SET FIELD=geometry.
> >
> > I've tried to use EXECUTE like this
> >
> > EXECUTE 'UPDATE '||quote_ident(table_name)||' SET
> FIELD='||geometry::geometry
> >
> > but I'm getting an error in the geometry: (HINT:  Could not choose a best
> candidate operator. You might need to add explicit type casts.)
> >
> > any ideas ?
> >
> > --
> > Sebastian E. Ovide
> >
> >
> >
> >
> > _______________________________________________
> > postgis-users mailing list
> > postgis-users@postgis.refractions.net
> > http://postgis.refractions.net/mailman/listinfo/postgis-users
>
> _______________________________________________
> postgis-users mailing list
> postgis-users@postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>



-- 
Sebastian E. Ovide
_______________________________________________
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users

Reply via email to