problem with returning values from pl/pgsql - Mailing list pgsql-novice

From Luis Silva
Subject problem with returning values from pl/pgsql
Date
Msg-id BAY18-F9D38D16E550BAF1CB2DE0B5140@phx.gbl
Whole thread Raw
In response to Re: sending N selects with begin and commit and get the result  (Andrew Chambers <andychambers2002@yahoo.co.uk>)
Responses quering NULL values  ("Luis Silva" <lfs12@hotmail.com>)
List pgsql-novice
I there!! I'm using pl/pgsql in my application, but I'm having a problem
with the returning value. What my function does is quering the db and
according to the result of the different queries returns a error message or
some information from the db. I'm inserting the correct information in a
record variable, but I cant insert text in a variable like this,the error
message created by me. Is it possible, or is there another returning type
that I can use??

DECLARE
val_pub text;
asds Record;

BEGIN
RAISE NOTICE 'validate_user()';
    val_pub:=$1;

    EXECUTE 'SELECT count(*) FROM public_identif  WHERE
identity='||quote_literal(val_pub) INTO asds;

    IF asds.count=0 THEN
        RETURN 'DIAMETER_ERROR_USER_UNKNOWN';
    END IF;

EXECUTE 'SELECT name FROM public_identif  WHERE
identity='||quote_literal(val_pub) INTO asds;

       RETURN name;   -----array of text!!!!!!!!!!!!!!!!!!!!!!!!!!!!!



RETURN NULL;
END;


tks a lot in advance



pgsql-novice by date:

Previous
From: s21113298@tuks.co.za
Date:
Subject: Password Authentication Error
Next
From: Luzmar Caicedo Useche
Date:
Subject: Problema con postgresql 8.1.2