Re: jdbc cursor positioning
| От | Toby |
|---|---|
| Тема | Re: jdbc cursor positioning |
| Дата | |
| Msg-id | 5.1.0.14.0.20021006202100.00a73c58@mail.flirble.org обсуждение исходный текст |
| Ответ на | jdbc cursor positioning ("G.Nagarajan" <gnagarajan@dkf.de>) |
| Ответы |
Re: jdbc cursor positioning
|
| Список | pgsql-jdbc |
as i understand it, postgres doesn't yet support cursors. however, with the LIMIT and OFFSET modifiers in a SELECt you can get the same behaviour.
SELECT <fields> FROM <table> ORDER BY <field> LIMIT <recsPerPage> OFFSET <offset>
<fields> is the fields to select
<table> is the table you're selecting from
<recsPerPage> is an integer 1..n for the number of records per page.
<offset> is calculated as ((page - 1) * recsPerPage) where the page number is 1..n
make sure you order your select by something, else the records in a page may not quite make sense.
toby
SELECT <fields> FROM <table> ORDER BY <field> LIMIT <recsPerPage> OFFSET <offset>
<fields> is the fields to select
<table> is the table you're selecting from
<recsPerPage> is an integer 1..n for the number of records per page.
<offset> is calculated as ((page - 1) * recsPerPage) where the page number is 1..n
make sure you order your select by something, else the records in a page may not quite make sense.
toby
В списке pgsql-jdbc по дате отправления: