A Query that works standalone but not in a f(x) - Mailing list pgsql-general

From Ralph Smith
Subject A Query that works standalone but not in a f(x)
Date
Msg-id 4D389B90.8090001@10kinfo.com
Whole thread Raw
Responses Re: A Query that works standalone but not in a f(x)
List pgsql-general
Within the function I have:

for darec in select * from purchbt where addr not like ''%STE%STE%'' and addr not like ''%STE%STE%STE%'' and  (addr similar to ''%STE[A-Z]*[0-9]+'' or addr similar to ''%STE[A-Z]*[0-9]+[A-Z]'' or addr similar to ''%STE[A-Z]*[0-9]+[A-Z][A-Z]'')  loop

and it finds no records.
Outside the function, replace '' with ', I DO get the results I expect.
Back and forth, it's reliable.

I tried putting the COUNT(*) into a var and it finds 0 w/in the function and 59K recs as a standalone query.

Any ideas?
Thanks!
-- 

Ralph
_________________________

pgsql-general by date:

Previous
From: Michael Gould
Date:
Subject: Re: Moving from SQL Anywhere to PostGres - First Time
Next
From: Tom Lane
Date:
Subject: Re: A Query that works standalone but not in a f(x)