Re: DLookup('field', 'table', ['condition'])

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: DLookup('field', 'table', ['condition'])
Дата
Msg-id Pine.BSF.4.21.0102262021570.34291-100000@megazone23.bigpanda.com
обсуждение исходный текст
Ответ на DLookup('field', 'table', ['condition'])  (Herbert Ambos <herbert@hindang.msuiit.edu.ph>)
Список pgsql-sql
On Tue, 27 Feb 2001, Herbert Ambos wrote:

> I'm trying to create Domain Aggregate function that mimic Access' Dlookup
> function, but without any luck, after digging (i think) all the docs
> don't have the solution yet.
> 
> Syntax:
> 
>     DLookup ('field', 'table|view', ['condition'])
> 
>     where:
>     field --               column name or calculation
>         table|view --
>     condition (optional) -- SQL WHERE condition without the
>                      WHERE keyword
>     
>     If the query returns multiple rows then it will only get the
>     topmost column.
>     If the query retuns 0 rows then NULL would be returned
> 
> 
> An example argument to the function would be
> 
>     DLookup ('id', 'student', 'name=\'Bill Gates\'') --> '2001-432'

Is this supposed to give effectively the same result as the subquery 
(select student.id where name='Bill Gates' limit 1)?  I don't think
that subquery is supported in 7.0, but will be in 7.1 along with 
EXECUTE for plpgsql which should let you build a query out of the
parts you give it.  I think you'd possibly be able to do this in 7.0 
using pltcl but I don't know tcl so I can't help there.



В списке pgsql-sql по дате отправления:

Предыдущее
От: Herbert Ambos
Дата:
Сообщение: DLookup('field', 'table', ['condition'])
Следующее
От: "postgresql"
Дата:
Сообщение: underscore problem