problem with returning values from pl/pgsql
От | Luis Silva |
---|---|
Тема | problem with returning values from pl/pgsql |
Дата | |
Msg-id | BAY18-F9D38D16E550BAF1CB2DE0B5140@phx.gbl обсуждение исходный текст |
Ответ на | Re: sending N selects with begin and commit and get the result (Andrew Chambers <andychambers2002@yahoo.co.uk>) |
Ответы |
quering NULL values
|
Список | 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 по дате отправления: