From: | Mauricio Ferrari <mautuc(at)yahoo(dot)com(dot)ar> |
---|---|
To: | Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl> |
Cc: | pgsql-es-ayuda(at)postgresql(dot)org |
Subject: | Re: enviar sentencias a psql desde script |
Date: | 2004-12-21 12:42:10 |
Message-ID: | 20041221124210.63258.qmail@web54606.mail.yahoo.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-es-ayuda |
Muchas gracias funciona una maravilla.
--- Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl> escribió:
> On Mon, Dec 20, 2004 at 08:17:25PM -0300, Mauricio
> Ferrari wrote:
>
> Hola,
>
> > read TABLA
> >
> > psql Base < DELETE FROM $TABLA
> >
> > echo LA TABLA $TABLA FUE VACIADA!.
> >
> > y el error que me da es que no existe el archivo,
> he
> > probado tambien asignando la sentencia a una
> variable
> > pero me dice redireccion ambigua.
>
> Una redireccion < toma el nombre de un archivo. Si
> quieres pasarle un
> string, necesitas un pipe:
>
> echo "DELETE FROM $tabla" | psql Base
>
> O mas facil aun, usa -c de psql:
>
> psql Base -c "DELETE FROM $tabla"
>
> --
> Alvaro Herrera (<alvherre[(at)]dcc(dot)uchile(dot)cl>)
> "Someone said that it is at least an order of
> magnitude more work to do
> production software than a prototype. I think he is
> wrong by at least
> an order of magnitude."
> (Brian Kernighan)
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 4: No hagas 'kill -9' a postmaster
>
__________________________________________________
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis!
¡Abrí tu cuenta ya! - http://correo.yahoo.com.ar
From | Date | Subject | |
---|---|---|---|
Next Message | Mario A. Soto Cordones | 2004-12-21 14:38:34 | Re: Problema con ODBC de Postgresql |
Previous Message | Rodrigo Tachoires | 2004-12-21 12:38:54 | favor retirarme de la lista |