Re: Passing TEXT variable to a function - Mailing list pgsql-novice

From Josh Berkus
Subject Re: Passing TEXT variable to a function
Date
Msg-id 200408241428.50672.josh@agliodbs.com
Whole thread Raw
In response to Passing TEXT variable to a function  (Betsy Barker <betsy.barker@supportservicesinc.com>)
Responses Re: Passing TEXT variable to a function
List pgsql-novice
Betsy,

> The variable is defined as TEXT, and I'm trying to pass it to a function
> that is setup to accept a TEXT parameter. Here is the call:

First off, let me say that you may be better off using a different strategy
for this.  But I don't know much about your application, so you may not.

>         FOR getpercentiles IN EXECUTE ''SELECT * FROM
> get_facility_percentiles(''||wagerateid_list||'')'' LOOP --      RAISE
> NOTICE ''DONE CALLING FUNCTION '';

Aha, syntax error, you forgot the nested quotes:

FOR getpercentiles IN EXECUTE ''SELECT * FROM get_facility_percentiles(''''''
|| wagerateid_list || '''''')'' LOOP

FWIW, version 8.0 will have a feature to do away with the nested-quote-mania.

--
Josh Berkus
Aglio Database Solutions
San Francisco

pgsql-novice by date:

Previous
From: Tom Lane
Date:
Subject: Re: Passing TEXT variable to a function
Next
From: Tom Lane
Date:
Subject: Re: Passing TEXT variable to a function