Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Re: [opensuse-es] Re: pl/pgsql para torpes


  • From: jcb <jcb(at)greccosoft(dot)es>
  • To: pgsql-es-ayuda <pgsql-es-ayuda(at)postgresql(dot)org>
  • Subject: Re: [opensuse-es] Re: pl/pgsql para torpes
  • Date: Fri, 30 May 2008 18:41:33 +0200
  • Message-id: <1212165693(dot)4674(dot)8(dot)camel(at)hwcasa(dot)a>


Perdon mi intención no  era mandarlo 3 veces pero es que el mensaje nunca me
llegaba, los envie a las 11 y  a las 2 todavía no las había recibido.

Aprovecho para preguntaros si hay una guia rapida de pl/pgsql es castellano, he
visto una y no consigo mucho

No entiendo bien como introducir las variables en las cadenas de los execute, yo
intento montar la cadena con el valor , pero creo que debe de ser de otra manera,
supongo que poniendo variables que en el momento de ejecución va ha sustituir, lo
hago de esta forma : 


                aux0 := 'select distinct
c.empresa,to_number(to_char(c.fecha,''YYYYMMDDHH24''),''9999999999''),to_number(to_char(c.fecha,''YYYY''),''9999''),

 to_number(to_char(c.fecha,''Q''),''9'') to_number(to_char(c.fecha,''MM''),''99''),                      
to_number(to_char(c.fecha,''W''),''9''),                       
 to_number(to_char(c.fecha,''WW''),''99''),
 to_number(to_char(c.fecha,''ID''),''9''),                       
> > to_number(to_char(c.fecha,''DD''),''99'')
> > >                        from    gc05albc c,gc06albl l
> > 
> > >                        where   c.empresa       = ''' ||
> > dw01.empresa || '''
> > >                        and     c.serie         =
> > l.serie
> > >                        and     c.albaran       =
> > l.albaran
> > >                        and     c.fecha         >=''' ||
> > dw01.fecha_inicial
> > > || '''
> > 
> > >                        and     c.proveedor     =
> > l.proveedor
> > >                        and     l.tipo          = 1
> > 
> > >                        and     l.unidades       0
> > 
> > >                        and   length(l.articulo) = 0';
> > 
> > >        end if;
> > 
> > >
> > 
> > >        OPEN dw0_0010_1_c FOR EXECUTE aux0;
> > 
> > >
> > 
> > >        RAISE NOTICE 'PASA';
> > 
> > >        LOOP
> > 
> > >                FETCH dw0_0010_1_c INTO dw10;
> > 
> > >                EXIT WHEN NOT FOUND;
> > 
> > >                RAISE NOTICE 'prueba', dw10.tiempo;
> > 
> > >        END LOOP;
> > 
> > >
> > 
> > >        RAISE NOTICE 'PASA FIN';
> > 
> > >
> > 
> > >        RETURN 0;
> > 
> > > END;
> > 
> > > $BODY$
> > 
> > >  LANGUAGE 'plpgsql' VOLATILE
> > 
> > >
> > 
> > >
> > 
> > >
> > 
> > >
> > 
> > > __________ Information from ESET NOD32 Antivirus,
> > version of virus signature
> > > database 3146 (20080530) __________
> > 
> > >
> > 
> > > The message was checked by ESET NOD32 Antivirus.
> > 
> > >
> > 
> > > http://www.eset.com
> > >
> > 
> > >
> > 
> > > --
> > 
> > > TIP 1: para suscribirte y desuscribirte, visita
> http://archives.postgresql.org/pgsql-es-ayuda
> > >
> > 
> > 
> > 
> > Estimado :
> > 
> > Con que envio el correo solo una vez basta, ha llegado tres veces,
> > 
> > creo que si existe alguien de la lista que pueda respondder a tu duda
> > 
> > lo hara lo mas rapido posible, saludos.
> > 
> > J
> > 
> > -- 
> > 
> > ----------------------
> > 
> > Slds.
> > 
> > jchavez
> > 
> > linux User #397972 on http://counter.li.org/
> > 
> > 
> > 
> 
> 
> ---------------------------------------------------------------------
> Para dar de baja la suscripción, mande un mensaje a:
>    opensuse-es+unsubscribe(at)opensuse(dot)org
> Para obtener el resto de direcciones-comando, mande
> un mensaje a:
>    opensuse-es+help(at)opensuse(dot)org
> 
> 




Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group