Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 8F08064FCCD for ; Wed, 10 Sep 2008 12:45:29 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 97668-07 for ; Wed, 10 Sep 2008 12:45:23 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.231]) by postgresql.org (Postfix) with ESMTP id 884D364FCCB for ; Wed, 10 Sep 2008 12:45:23 -0300 (ADT) Received: by rv-out-0506.google.com with SMTP id b25so3369439rvf.43 for ; Wed, 10 Sep 2008 08:45:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:mime-version:content-type; bh=7+u7pww6apS8k8cmvjvKSdwLQ8dgCCMX9VpuA6tntFo=; b=yGMHo1uixHxdFV7hw+A3SGs9DmiHRgifngYOfrtJKEXmNOyq8+ufZ9IcZSJYd0QiVx /UsgISChgGl3zcIXBFhx0atfpS/powIudTd27/iDA89z2oTtjD3zXR7QJmVOnjnjZnM+ DVPikH3diB905fMgx1k47NbQIKEFfBXsEuXYY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type; b=eH1VHOGw29DIFwkbKZWkCPEJ8JMbQGCT7DxkqfMW71VL7tmcD5q4rUrwIcSTuE2n0o HSBUTz44B9lpMc5QacA8n47eNTZW+RWj1eU7MqacVg7kA05CFicLtRVDNAhux+k76I0k qEe6+Q+GNDKw/L1IIgO4ZcEvv0yMp0wG9fplI= Received: by 10.140.202.21 with SMTP id z21mr914836rvf.81.1221061521198; Wed, 10 Sep 2008 08:45:21 -0700 (PDT) Received: by 10.141.177.16 with HTTP; Wed, 10 Sep 2008 08:45:21 -0700 (PDT) Message-ID: Date: Wed, 10 Sep 2008 10:45:21 -0500 From: davyd To: pgsql-admin@postgresql.org Subject: dynamic SQL MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_9818_28320243.1221061521196" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 200809/78 X-Sequence-Number: 30171 ------=_Part_9818_28320243.1221061521196 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline 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 Thanks.. ------=_Part_9818_28320243.1221061521196 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline
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

Thanks..

------=_Part_9818_28320243.1221061521196--