Store Procedure





2
Date Submitted Mon. Jun. 9th, 2008 6:54 PM
Revision 1 of 1
Beginner vertxch
Tags postgresql | procedure | store
Comments 0 comments
Store Procedure en PostgreSql 8.2
/* CREAR UN SP PARA OBTENER TOTAL IMPORTE POR DESTINO*/


CREATE OR REPLACE FUNCTION spimptotxdes(varchar(50))
RETURNS numeric(9,2)
AS'
        DECLARE
                vdestino ALIAS FOR $1;
                vimptot numeric(9,2);
        BEGIN
                SELECT INTO vimptot sum(importe)
                FROM tembarque
                WHERE destino=vdestino;
                RETURN vimptot;
        END;
'
LANGUAGE 'plpgsql';

 

Daniel Hernández

www.vertxch.blogspot.com/

Comments

There are currently no comments for this snippet.

Voting

Votes Up


Syntax Master dannyboy
Beginner vertxch

Votes Down