-
Naja, ganz so ist es leider nicht.
SQL hält einen Insert-Cursor automatisch geöffnet (ODP), da ja noch ein 2. Insert folgen könnte und somit SQL diverse Routinen (Open, Prepare, Field- und Type-Check usw.) spart.
Das ist auch kein Bug (@Dieter) sondern vom Optimizer so gewollt.
Es gibt noch die Option, wann ein Cursor geschlossen werden soll:
set option closqlcsr=*endmod
Wenn das Modul beendet ist, werden alle SQL-Statements freigegeben und ODP's geschlossen (Default = *endjob):
CLOSQLCSR
Specifies when SQL cursors are implicitly closed, SQL prepared statements are implicitly discarded,
and LOCK TABLE locks are released. SQL cursors are explicitly closed when you issue the CLOSE,
COMMIT, or ROLLBACK (without HOLD) SQL statements. This option will be ignored in REXX.
*ENDACTGRP and *ENDMOD are for use by ILE programs and modules. *ENDPGM, *ENDSQL, and
*ENDJOB are for use by non-ILE programs.
This option is not allowed in an SQL function, SQL procedure, or SQL trigger.
*ENDACTGRP
SQL cursors are closed, SQL prepared statements are implicitly discarded, and LOCK TABLE
locks are released when the activation group ends.
*ENDMOD
SQL cursors are closed and SQL prepared statements are implicitly discarded when the module is
exited. LOCK TABLE locks are released when the first SQL program on the call stack ends.
*ENDPGM
SQL cursors are closed and SQL prepared statements are discarded when the program ends.
LOCK TABLE locks are released when the first SQL program on the call stack ends.
*ENDSQL
SQL cursors remain open between calls and can be fetched without running another SQL OPEN.
One of the programs higher on the call stack must have run at least one SQL statement. SQL
cursors are closed, SQL prepared statements are discarded, and LOCK TABLE locks are released
when the first SQL program on the call stack ends. If *ENDSQL is specified for a program that is
the first SQL program called (the first SQL program on the call stack), the program is treated as if
*ENDPGM was specified.
*ENDJOB
SQL cursors remain open between calls and can be fetched without running another SQL OPEN.
The programs higher on the call stack do not need to have run SQL statements. SQL cursors are
left open, SQL prepared statements are preserved, and LOCK TABLE locks are held when the first
SQL program on the call stack ends. SQL cursors are closed, SQL prepared statements are
discarded, and LOCK TABLE locks are released when the job ends.
Similar Threads
-
By ILEMax in forum IBM i Hauptforum
Antworten: 16
Letzter Beitrag: 24-01-07, 10:04
-
By Squall in forum NEWSboard Programmierung
Antworten: 23
Letzter Beitrag: 18-10-06, 13:01
-
By loeweadolf in forum NEWSboard Programmierung
Antworten: 3
Letzter Beitrag: 18-06-06, 13:14
-
By loeweadolf in forum NEWSboard Programmierung
Antworten: 2
Letzter Beitrag: 01-06-06, 10:43
-
By e_sichert in forum NEWSboard Programmierung
Antworten: 3
Letzter Beitrag: 03-05-06, 11:47
Berechtigungen
- Neue Themen erstellen: Nein
- Themen beantworten: Nein
- You may not post attachments
- You may not edit your posts
-
Foren-Regeln
|
Erweiterte Foren Suche
Google Foren Suche
Forum & Artikel Update eMail
AS/400 / IBM i
Server Expert Gruppen
Unternehmens IT
|
Kategorien online Artikel
- Big Data, Analytics, BI, MIS
- Cloud, Social Media, Devices
- DMS, Archivierung, Druck
- ERP + Add-ons, Business Software
- Hochverfügbarkeit
- Human Resources, Personal
- IBM Announcements
- IT-Karikaturen
- Leitartikel
- Load`n`go
- Messen, Veranstaltungen
- NEWSolutions Dossiers
- Programmierung
- Security
- Software Development + Change Mgmt.
- Solutions & Provider
- Speicher – Storage
- Strategische Berichte
- Systemmanagement
- Tools, Hot-Tips
Auf dem Laufenden bleiben
|
Bookmarks