From: | "Mario Soto" <mario_soto(at)venezolanadeavaluos(dot)com> |
---|---|
To: | <eaponte(at)usb(dot)ve> |
Cc: | <pgsql-es-ayuda(at)postgresql(dot)org> |
Subject: | Re: Postgre |
Date: | 2004-07-09 16:27:08 |
Message-ID: | 38299.200.35.66.77.1089390428.squirrel@mail.venezolanadeavaluos.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-es-ayuda |
Ve el siguiente link, ´se explica como crear un lenguaje:
http://es.tldp.org/Postgresql-es/web/navegable/programmer/xplang.html#XPLANG
--
Ing. Mario Soto Cordones
Venezolana de Avaluos
>
> Hola, buenos días, tengo un problemita con Postgre, primero, solamente
> veo el lenguaje sql, c e internal, estoy trabajando con lenguaje sql,
> estoy creando unas funciones donde necesito verificar algo con el
> condicional IF y de verdad que no se como hacerlo, he logrado trabajar
> con insert into, update, select, pero al tratar de utilizar el
> condicional me da el siguiente error, les envio el codigo de la funcion
>
> Error de SQL:
> ERROR: parser: parse error at or near "IF" at character 49
>
> En la declaración:
> CREATE OR REPLACE FUNCTION "insertar_log" (integer, character varying,
> character varying, character varying, character varying) RETURNS
> character varying AS '
> select $1 = max(cod_log) as maximo from logs;
> IF $1 = 0 THEN
> BEGIN
>
> END;
> END IF;
>
> INSERT INTO LOGS (COD_LOG,LOGIN_LOG, FECHA_LOG, HORA_LOG, OBVS_LOG)
> VALUES ($1, $2, $3, $4, $5);
> select login_log from logs where cod_log = $1;
>
> ' LANGUAGE "sql"
>
>
> gracias de antemano a quien o quienes me puedan ayudar
>
> saludos de venezuela
From | Date | Subject | |
---|---|---|---|
Next Message | Martin figueroa salazar | 2004-07-09 17:17:40 | Manejo de Interfaz |
Previous Message | Alvaro Herrera | 2004-07-09 15:43:29 | Re: Postgre |