From: Oliveiros Cristina <oliveiros.cristina@marktest.pt>
To: Jhonny Velasquez c. <jhon_vels@hotmail.com>
To: pgsql-sql@postgresql.org
To: pgsql-php@postgresql.org
Subject: Re: uso de dblink en php
Date: Thu, 5 Mar 2009 18:25:38 -0000
Message-ID: <002e01c99dbf$c8b96f40$ec5a3d0a@marktestcr.marktest.pt> (raw)
References: <SNT102-W19A390056CA0457783EF4E9FA40@phx.gbl>
Escribe tu duda en ingles, por favor
Saludos,
Oliveiros
----- Original Message -----
From: Jhonny Velasquez c.
To: pgsql-sql@postgresql.org ; pgsql-php@postgresql.org
Sent: Thursday, March 05, 2009 3:50 PM
Subject: [SQL] uso de dblink en php
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
------------------------------------------------------------------------------
check out the rest of the Windows Live™. More than mail–Windows Live™ goes way beyond your inbox. More than messages
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: oliveiros.cristina@marktest.pt, jhon_vels@hotmail.com, pgsql-sql@postgresql.org
Subject: Re: uso de dblink en php
In-Reply-To: <002e01c99dbf$c8b96f40$ec5a3d0a@marktestcr.marktest.pt>
References: <SNT102-W19A390056CA0457783EF4E9FA40@phx.gbl> <002e01c99dbf$c8b96f40$ec5a3d0a@marktestcr.marktest.pt>
* 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