pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jhonny Velasquez c. <jhon_vels@hotmail.com>
To: pgsql-sql@postgresql.org
To: pgsql-php@postgresql.org
Date: Thu, 5 Mar 2009 11:48:17 -0400
Message-ID: <SNT102-W2BDF6938BB309DC4A240C9FA40@phx.gbl> (raw)


hola a todos

 

estoy programando en php

tengo el siguiente esquema de BD

 

BDACADEMICA
 personas(idpersona, nombres, paterno)


BDSIAP
 PersonasDatosActualizables(idpersona, direccion, telefono) 


 

son dos bases de datos, de las cuales mediante una sola consulta quiero unir los datos de la misma persona, creo que se puede hacer con dblink, no se si hay otra forma mejor. 

 

   $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.


Warning: pg_query() [function.pg-query]: Query failed: ERROR: error de sintaxis en o cerca de «FROM» at character 69 in /var/www/finanzas/prueba.php on line 16

 

 

espero su ayuda

 

saludos

 

jhonvels

_________________________________________________________________
More than messages–check out the rest of the Windows Live™.
http://www.microsoft.com/windows/windowslive/=

view thread (4+ messages)  latest in thread

Message-ID: <SNT102-W2BDF6938BB309DC4A240C9FA40@phx.gbl>
Permalink:  ../SNT102-W2BDF6938BB309DC4A240C9FA40@phx.gbl/
Also on:    postgresql.org/message-id/SNT102-W2BDF6938BB309DC4A240C9FA40@phx.gbl

 · 

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: jhon_vels@hotmail.com, pgsql-sql@postgresql.org
  Subject: Re: 
  In-Reply-To: <SNT102-W2BDF6938BB309DC4A240C9FA40@phx.gbl>
  References: <SNT102-W2BDF6938BB309DC4A240C9FA40@phx.gbl>

* 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