Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PERFORM STATEMENT

Status
Not open for further replies.

WP

Programmer
Nov 30, 1999
463
CH
I have a function

CREATE OR REPLACE FUNCTION rules_broken(ordref bigint)
RETURNS character varying AS

DECLARE
rules RECORD;
rulesbroken character varying;
ordsource character varying;

BEGIN

FOR rules IN SELECT rul_id,rul_sql FROM sd_stp_rules ORDER BY rul_id LOOP

EXECUTE rules.rul_sql || ' AND ord_id =' || ordref;

If found then
rulesbroken:=rulesbroken || rules.rul_id || ';';
end if;

END LOOP;

RETURN rulesbroken;
END;

In my table sd_STP_rules.rul_sql I had simple selects e.g.
SELECT COUNT(*) FROM d_order WHERE ....

This bombs. I read that I should use a PERFORM statement but again this bombs.

Anybody have a clue of the correct syntax of the PERFOM statement.

I have been trying PERFORM Select Count(*) FROM d_order WHERE ....

and also PERFORM Count(*) FROM d_order WHERE ....

but no joy

any help here would be much appreciated ...


Thanks W


WP

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top