Re: Queries using the C API

Поиск
Список
Период
Сортировка
От Jurgen Defurne
Тема Re: Queries using the C API
Дата
Msg-id 39217E76.71FB247B@glo.be
обсуждение исходный текст
Ответ на Queries using the C API  (Marcos Barreto de Castro <mbdecastro@yahoo.com>)
Список pgsql-general
Marcos Barreto de Castro wrote:

>    My questions are: Is there a skip function in
> Postgresql that I can use to browse through the
> records in a table forwards and backwards (That table
> has 50,000 records)? If not, how would I be able to
> develop
> such a mechanism as the one explained above? Are there
> examples of existing algorithms or even functions,
> libraries of functions fit for the job? Are there
> examples of free software developed using the
> Postgresql C API? If so, where can I find them?
>

You have to create a cursor :
DECLARE cursor_name CURSOR
FOR <enter your query here as a select statement> ;

Your select statement will act as a filter on your tables.

The declaration of the cursor (using embedded or dynamic
SQL statements) will open the cursor.

Then you can use FETCH FORWARD and FETCH BACKWARD
to browse through the cursor.

If you want to use the same cursor, but with another query,
then you need to close it (CLOSE cursor_name), recompose your
select statement and reopen the cursor.

I know xBase, and I have even used CodeBase (but that was 10
years ago). You will probably have to work somewhat harder on
using postgreSQL, although if your browse infrastructure good,
you could probably write a similar interface to postgreSQL as is
used in CodeBase.

Good luck,

Jurgen Defurne
defurnj@glo.be



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

Предыдущее
От: "Diego Schvartzman"
Дата:
Сообщение: Re: Performance
Следующее
От: Bruce Momjian
Дата:
Сообщение: HTML version of book fixed, again