Executing dynamic procedure call

From: tekwiz <ryoung(at)medicalpharmacies(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Executing dynamic procedure call
Date: 2008-05-02 14:25:12
Message-ID: 0df823a1-386a-4da0-be19-84e68877b695@q24g2000prf.googlegroups.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I am using a PL/pgSQL procedure. I am trying to hold the procedure
name in a table and then based on certain selection criteria get the
procedure name out of the table and execute it. I would like to pass a
row record, currently NEW, and retrieve the same rowtype. The
following code will compile but yields the result below it for either
of the two statements listed. Note that the procedure is triggered
from an insert running from a Perl script.

EXECUTE '"RuleRec.rule_procedure_name"(NEW)' INTO NEW;
or
NEW := "RuleRec.rule_procedure_name"(NEW);

Result:

DBD::Pg:st execute failed: ERROR: operator does not exist: money <>
integer
HINT: No operator matches the given name and argument type(s). You may
need to add explicit type casts.
CONTEXT: SQL statement "SELECT (( $1 - $2 - $3 - $4 - $%) <> 0)"

Can you help me code this correctly and, if possible, explain what's
happening here?

PG Ver: 8.1.3
DBD Ver: 1.48

Thanks.

Robert Young

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Scott Ribe 2008-05-02 14:29:28 Re: clustering without locking
Previous Message Craig Ringer 2008-05-02 14:09:01 Re: clustering without locking