Alain Roger wrote on 24.03.2008 15:45:
>> SELECT count(*) INTO existing_email FROM cust_portal.tmp_newsletterreg;
>> if (existing_email <>0) then
>> {
>> result = false;
>> }
>> else
>> {
>> result = true;
>> INSERT INTO cust_portal.tmp_newsletterreg VALUES
>> (
>> nextval( 'tmp_newsletterreg_nlreg_id_seq' ),
>> email,
>> session,
>> SELECT CURRENT_TIMESTAMP;
>> )
>> }
>> end if;
>>
>> RETURN(result);
That should be
INSERT INTO cust_portal.tmp_newsletterreg VALUES
(
nextval( 'tmp_newsletterreg_nlreg_id_seq' ),
email,
session,
CURRENT_TIMESTAMP
)
There is no SELECT and no semicolon inside the INSERT
Thomas