pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: F. Jovan Jester <jesterj@groupspeak.com>
To: Jhonny Velasquez c. <jhon_vels@hotmail.com>
Cc: pgsql-php@postgresql.org
Subject: Re:
Date: Wed, 11 Mar 2009 14:33:03 -0400
Message-ID: <CEAE5241-60D6-4674-9A08-8254178D09AF@groupspeak.com> (raw)
In-Reply-To: <SNT102-W2BDF6938BB309DC4A240C9FA40@phx.gbl>
References: <SNT102-W2BDF6938BB309DC4A240C9FA40@phx.gbl>

Hola:

>    $result=pg_query( $linkacademica,"SELECT personas.nombres,  
> personas.paterno, s.direccion, s.telefono, FROM personas INNER JOIN  
> dblink('dbname=bdsiap port=5432 host=localhost user=usuario  
> password=clave,'SELECT idpersona, direccion, telefono FROM  
> personasdatosactualizables') AS s(idpersona character(15), direccion  
> character varying(50), telefono character varying(25)) ON  
> personas.idpersona = s.idpersona");
>
> usando db link me da el siguiente error, supongo que es por las  
> comillas, he intentado con comillas dobles y simples pero nada,  
> tambien he intentado usar variables.
>

Respecto al error, además del ya mencionado coma sobrante antes del  
FROM, parece que falta cerrar las comillas sencillas después de la  
clave y antes del SELECT dentro de la función dblink: ...  
password=clave','SELECT ...

Si las dos bases de datos están en la misma máquina, recomiendo que  
investigues el uso de esquemas para separar las tablas en lugar de  
usar dblink. ver 'CREATE SCHEMA' .

Por cierto, esta es la lista en español:
http://archives.postgresql.org/pgsql-es-ayuda/
pgsql-es-ayuda@postgresql.org

además esta lista PHP tiene muy poco tráfico

saludos
-Jovan

view thread (4+ messages)

Message-ID: <CEAE5241-60D6-4674-9A08-8254178D09AF@groupspeak.com>
Permalink:  ../CEAE5241-60D6-4674-9A08-8254178D09AF@groupspeak.com/
Also on:    postgresql.org/message-id/CEAE5241-60D6-4674-9A08-8254178D09AF@groupspeak.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-php@postgresql.org
  Cc: jesterj@groupspeak.com, jhon_vels@hotmail.com
  Subject: Re: 
  In-Reply-To: <CEAE5241-60D6-4674-9A08-8254178D09AF@groupspeak.com>
  References: <SNT102-W2BDF6938BB309DC4A240C9FA40@phx.gbl> <CEAE5241-60D6-4674-9A08-8254178D09AF@groupspeak.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox