Search Postgresql Archives

Re: plpgsql at what point does the knowledge of the query come in?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I found the problem, it looks like nnlength := length(newnode); is not getting reset

create or replace function nnodetestt(text) returns text language plpgsql as $$
DECLARE
newnode alias for $1;
nnlength integer;
t text;
nmarker text;
BEGIN
nnlength := length(newnode);
for i in 1..(nnlength-1) loop
select into t
node
from
(Values('threeee','N'),('threee',''),('fiveu','N'),('five',''))
blast(node,nmarker)
where node = substring(newnode,1,i-1)||substring(newnode,i+1,nnlength);
end loop;
return t;
END;
$$

select
node as node_orig,
nmarker,
nnodetestt(node),
case
when nmarker = 'N' then
nnodetestt(node)
end
from
(Values('threeee','N'),('threee',''),('fiveu','N'),('five',''))
blast(node,nmarker)

"threeee";"N";"threee";"threee"
"threee";"";"";""
"fiveu";"N";"";""
"five";"";"";""



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux