having a slight issue here, trying to call this function, but getting this error:
ERROR: query has no destination for result data
HINT: If you want to discard the results of a SELECT, use PERFORM instead.
used perform but that is not what I need. I don't understand the error message, do i need to return a table or something?
create or replace procedure myProc(colkey varchar, colvalue varchar)
language plpgsql
as $$
declare
old varchar(250);
keyId bigint;
begin
select @keyid= id
from conkey
where conkey.key like colkey
limit 1;
if not exists (select * from ConValu where conkeyId= @keyid and appId is null) THEN
else
select @old_value_for_update = value
from ConValu
where conkeyId= @conkeyId and appId is null
limit 1;
update ConValu set Value = colvalue where ConkeyId= @conkeyID and appId is null;
end if;
end; $$
@in PL/pgSQL. When you run a query you need to store the result somewhere