Home   Artículos   Recursos   Foros   
Artíclos recientes publicados en Latindevelopers:
Visual C++: NSDoubleEdit: Un control para el manejo de números decimales en Visual C++.
Visual C++: Implementando una Calculadora en Visual C++
Visual C++: CCommandLine: Una clase para el uso de la linea de comando
Visual C++: Una clase para el manejo del Registro

PROBLEMA CONFUNCION AYUDA

Arquitectura, Extending SQL, The Postgree Rule System, Intefacing, Trigers, ODBC, JDBC, C++...

PROBLEMA CONFUNCION AYUDA

Notapor vicenct06 el Sab Jul 07, 2007 7:35 pm

HOLA

TENGO UN PROBLEMA CON UNA FUNCION POR FAVOR CHEQUEEN Y PODRIAN DECIRME QUE ESTA MAL O QUE ME FALTA

CREATE OR REPLACE FUNCTION actafe()
RETURNS SETOF int4 AS
$BODY$
DECLARE
cCodAfe char(5)=null;
nResultado integer=0;
xCurSer refcursor;
xCurArt refcursor;
cCodSer char(8);
nPreSer numeric(12,2);
nPctAfe integer;
nNewPre numeric(12,2)=0;

BEGIN
cCodAfe:=1;
nResultado:=0;
Open xCurSer FOR SELECT * from a11pafs WHERE "cCodAfe" = cCodAfe;
FETCH xCurSer INTO cCodSer;
While found LOOP
Select nPreSer="nPreSer" from A11MSER Where "cCodSer"=cCodSer;
Select nPctAfe="nPctAfe" from A11MAFE Where "cCodAfe"=cCodAfe;
nNewPre:=nPreSer*(nPctAfe/100);
UPDATE A11PAFS set "nPreven"=nNewPre where "cCodSer" = cCodSer and "cCodAfe"=cCodAfe;
FETCH xCurSer INTO cCodSer;
End Loop;
CLOSE xCurSer;
COMMIT;
END;
$BODY$
LANGUAGE 'plpgsql' VOLATILE;
ALTER FUNCTION actafe() OWNER TO postgres;

Select actafe();

CUANDO LA EJECUTO ME SALE ESTE ERROR:

ERROR: SELECT query has no destination for result data
HINT: If you want to discard the results, use PERFORM instead.
CONTEXT: PL/pgSQL function "actafe" line 16 at SQL statement

QUE DEBO HACER .
GRACIAS POR LA AYUDA
vicenct06
Novato
Novato
 
Mensajes: 1
Registrado: Mié Jul 26, 2006 10:30 pm

Volver a PostgreSQL

¿Quién está conectado?

Usuarios navegando por este Foro: No hay usuarios registrados visitando el Foro y 0 invitados