Cursor auf Abfrage mit sp_executesql

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Annegret Jäger (anonymous_at_discussions.microsoft.com)
Date: 06/30/04


Date: Wed, 30 Jun 2004 00:33:43 -0700

Hallo Benno,

Du kannst den SQL-Befehl um einen INSERT erweitern und
damit das Ergebnis in eine temporäre Tabelle speichern.
Die kann dann über mit einem Cursor bearbeitet werden.

Gruß Anne
>-----Originalnachricht-----
>Hallo,
>
>wenn ich einen Abfragestring mit sp_executesql in einer
Prozedur ausführe
>bekomme ich ein Resultset. Gibt es eine Möglichkeit einen
Cursor auf dieses
>Resultset zu bekommen, um die ermittelten Daten z. B. in
einer Schleife mit
>Fetch zu durchlaufen.
>
>Grüße
>
>Benno
>
>.
>



Relevant Pages

  • Re: SelectMethod=cursor and SelectMethod=direct
    ... All the database updates/inserts are done by sql using a prepared statement and then setting the field parameters. ... My only concern is the memory usage as a direct cursor reads the complete resultset into memory. ... If the free MS driver reads everything in immediately, it's just something you would have to deal with, alloting your client enough memory to handle it. ...
    (microsoft.public.sqlserver.jdbcdriver)
  • Re: Opinions on approach, please...
    ... To emulate this I plan on using an SQL cursor. ... I COULD do it with a resultset if it wasn't in COBOL or could ... Is it because when you FETCH from a cursor you go back to the ...
    (comp.lang.cobol)
  • Re: while loop in a while loop
    ... Depending on your database vendor and JDBC driver version, ... might not be able to reset the ResultSet cursor. ... The method ResultSet.firstmoves the cursor to the first row in the ...
    (comp.lang.java.programmer)
  • Re: TYPE_SCROLL_SENSITIVE
    ... the type for a ResultSet object that is scrollable and generally ... A sensitive cursor picks up data modifications impacting ... private static void update1throws SQLException { ...
    (comp.lang.java.programmer)
  • Re: Invalid cursor state - Am I completely stupid?
    ... > Therefore the resultset is on the first row ... Okay, suppose I did move the cursor one row forward. ... I suspect that my resultSet is empty, ...
    (comp.lang.java.programmer)