From: | "Mario A(dot) Soto Cordones" <mario_soto(at)venezolanadeavaluos(dot)com> |
---|---|
To: | <pgsql-es-ayuda(at)postgresql(dot)org> |
Subject: | |
Date: | 2004-09-24 14:55:07 |
Message-ID: | 34631.200.35.66.77.1096037707.squirrel@mail.venezolanadeavaluos.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-es-ayuda |
Hola lista, tengo la siguiente inquietud:
Tengo la siguiente funcion en lenguaje plpgsql
CREATE OR REPLACE FUNCTION "public"."sp_contador_subcuentadetalle_cont"
(numeric, numeric, numeric, numeric, numeric, numeric, numeric, numeric,
numeric, numeric) RETURNS bigint AS'
declare
x bigint;
a alias for $1;
b alias for $2;
c alias for $3;
d alias for $4;
e alias for $5;
f alias for $6;
g alias for $7;
h alias for $8;
j alias for $9;
k alias for $10;
i int;
begin
x := (select count(*) from activos where id_activo = ''SA'' and
co_empresa = a and co_filial = b and co_clase = c
and co_grupo = d and co_subgrupo = e and co_rubro = f and
co_cuentamayor = g and co_subcuentamayor = h and
co_cuentadetalle = j and co_subcuentadetalle = k);
if (x isnull) then
x := 0;
end if;
return x;
end
'LANGUAGE 'plpgsql' VOLATILE CALLED ON NULL INPUT SECURITY INVOKER;
y la quiero pasar a lenguaje C.
He hecho funciones en c para usarlas en postgres que realizan calculos,
pero esta se debe conectar a la base de datos.
Mi pregunta es como hago que C se conecte con postgres, he utilizado la
libreria postgres.h en el include pero no me funciona.... Alguien me puede
ayudar..
Gracias
mario
From | Date | Subject | |
---|---|---|---|
Next Message | jonathan sepulveda | 2004-09-24 15:14:42 | Crear base de datos con PHP |
Previous Message | enzo ana | 2004-09-24 14:38:31 | [SQL]Fallo de consulta SQL. |