Re: [SQL] Using function like where clause

From: Ragnar <gnari(at)hive(dot)is>
To: Ranieri Mazili <ranieri(dot)oliveira(at)terra(dot)com(dot)br>
Cc: pgsql-general(at)postgresql(dot)org, pgsql-sql(at)postgresql(dot)org
Subject: Re: [SQL] Using function like where clause
Date: 2007-08-07 18:20:37
Message-ID: 1186510837.5778.403.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-sql

On mán, 2007-08-06 at 16:44 -0300, Ranieri Mazili wrote:
> 1) Can I use a function that will return a string in a where clause like
> bellow?
>
> select *
> from table
> where my_function_making_where()
> and another_field = 'another_think'

you could have your function return a boolean instead of a string

> 2) Can I use a function that will return a string to return the list of
> columns that I want to show like below?
>
> select my_function_making_list_of_columns()
> from table
> where field_test = 'mydatum'

no

gnari

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Arthernan 2007-08-07 18:26:40 Internal Postgre SQL documentation
Previous Message novnov 2007-08-07 18:07:39 Reordering columns, will this ever be simple?

Browse pgsql-sql by date

  From Date Subject
Next Message Andrej Ricnik-Bay 2007-08-07 18:27:13 Re: [SQL] Restricting columns by users
Previous Message Ragnar 2007-08-07 18:18:14 Re: Range of caracters