Re: Referring to function parameter in function

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Thom Brown <thom(at)linux(dot)com>
Cc: PGSQL Mailing List <pgsql-general(at)postgresql(dot)org>
Subject: Re: Referring to function parameter in function
Date: 2010-09-17 23:14:53
Message-ID: 28853.1284765293@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thom Brown <thom(at)linux(dot)com> writes:
> ERROR: invalid input syntax for integer: "bitlength"
> LINE 1: SELECT GET_BIT(from_value::bit(bitlength), tap.value-1)
> ^

> I want to use the parameter called "bitlength" as the length of a bit
> when casting a value.

Hm, you can't ... that's not a valid place for a parameter. You'd have
to EXECUTE a built-up string.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Thom Brown 2010-09-17 23:52:57 Re: Referring to function parameter in function
Previous Message Thom Brown 2010-09-17 23:07:22 Referring to function parameter in function