Postgre

From: Eric Aponte <eaponte(at)usb(dot)ve>
To: pgsql-es-ayuda(at)postgresql(dot)org
Subject: Postgre
Date: 2004-07-09 14:19:58
Message-ID: 40EEA98E.40303@usb.ve
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda


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

Responses

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message Alvaro Herrera 2004-07-09 15:43:29 Re: Postgre
Previous Message carlos chamorro 2004-07-09 12:57:54 Retirarme de Lista