fetch from cursor

Поиск
Список
Период
Сортировка
От Chinthaka Kariyawasam
Тема fetch from cursor
Дата
Msg-id 3EE84D5C.000005.00956@chinthaka2k
обсуждение исходный текст
Список pgsql-general
I wrote a function in pl/pgsql which returns a cursor. I want to know how to fetch results from the cursor on the application using jdbc2.
following codes work but does not match to my case.
 
1. Statement stmt = con.createStatement(); // con is the sql connection
2. stmt.execute("BEGIN");   
3. int res = stmt.executeUpdate( "DECLARE test CURSOR FOR SELECT * FROM fare WHERE adult_value > 100.0" );
4. ResultSet rset = stmt.executeQuery( "FETCH FORWARD 10 IN test" );
 
here I just need to get the result from my function loadHighFares() instead of the SELECT statement in cursor declaration in line 3.
something like,
3. int res = stmt.executeUpdate( "DECLARE test CURSOR FOR SELECT loadHighFares()" );
 
but it does not work.
please can anyone help on this?
thanks and regards,
chinthaka
____________________________________________________
  IncrediMail - Email has finally evolved - Click Here
Вложения

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

Предыдущее
От: "Ivar"
Дата:
Сообщение: Is it bug ?
Следующее
От: David Wheeler
Дата:
Сообщение: ANNOUNCE: Bricolage 1.6.1