Re: dynamic SQL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Sep 10, 2008 at 9:45 AM, davyd <davydky@xxxxxxxxx> wrote:
> Hi list,
> I need to create a sql where the name of a tabla is on a variable..
>
> vbuffer        varchar;
>
> SELECT     buffer
> INTO     vbuffer
> FROM     rutas r, unidades u
> WHERE    r.codigo_ruta = u.codigo_ruta AND
> u.codigo_uni = 'B15_AFF666';
>
>
> SELECT within(the_geom,(SELECT geomunion(the_geom) from var vbuffer)) as
> inside

You'll need to do it by building the query as a string in a plpgsql
function and then execute it.


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux