[NEWSboard IBMi Forum]

Hybrid View

  1. #1
    Registriert seit
    Feb 2001
    Beiträge
    20.696
    Ggf. liegt es an dem Attribut "[NOT] DETERMNINISTIC" !

    DETERMINISTIC
    or NOT DETERMINISTIC Specifies whether the procedure returns the same results each time the procedure is called with the same IN and INOUT arguments.
    NOT DETERMINISTIC The procedure may not return the same result each time the procedure is called with the same IN and INOUT arguments, even when the referenced data in the database has not changed.
    DETERMINISTIC The procedure always returns the same results each time the procedure is called with the same IN and INOUT arguments, provided the referenced data in the database has not changed.

    Dienstleistungen? Die gibt es hier: http://www.fuerchau.de
    Das Excel-AddIn: https://www.ftsolutions.de/index.php/downloads
    BI? Da war doch noch was: http://www.ftsolutions.de

  2. #2
    Registriert seit
    Aug 2001
    Beiträge
    2.928
    Hallo,

    ich würde eher FENCED bzw. NOT FENCED vorschlagen. Dieses Schlüssel-Wort ist bereits V5R2 sowohl beim CREATE PROCEURE als auch beim CREATE FUNCTION verfügbar:

    FENCED or NOT FENCED
    Specifies whether the external function runs in an environment that is isolated from the database manager environment. FENCED is the default.

    FENCED
    The function will run in a separate thread.
    FENCED functions cannot keep SQL cursors open across individual calls to the function. However, the cursors in one thread are independent of the cursors in any other threads which reduces the possibility of cursor name conflicts.

    NOT FENCED
    The function may run in the same thread as the invoking SQL statement.
    NOT FENCED functions can keep SQL cursors open across individual calls to the function. Since cursors can be kept open, the cursor position will also be preserved between calls to the function. However, cursor names may conflict since the UDF is now running in the same thread as the invoking SQL statement and other NOT FENCED UDFs.
    NOT FENCED functions usually perform better than FENCED functions.

    Bei DETERMINISTIC werden die Ausgabe-Werte (Parameter- und Result Sets) zwischen gespeichert. Beim nächsten Aufruf mit den gleichen Parametern, wird die Prozedur nicht ausgeführt, sondern lediglich das zuvor gesicherte Ergebnis ausgegeben.

    Birgitta
    Birgitta Hauser

    Anwendungsmodernisierung, Beratung, Schulungen, Programmierung im Bereich RPG, SQL und Datenbank
    IBM Champion seit 2020 - 5. Jahr in Folge
    Birgitta Hauser - Modernization - Education - Consulting on IBM i

  3. #3
    Registriert seit
    Feb 2001
    Beiträge
    20.696
    Genau das DETERMINISTIC scheint ja das falsche Ergebnis zu bringen.

    Ausserdem sollten verschiedene Threads nicht die selbe Connection sharen, das führt immer zu Problemen.
    Dienstleistungen? Die gibt es hier: http://www.fuerchau.de
    Das Excel-AddIn: https://www.ftsolutions.de/index.php/downloads
    BI? Da war doch noch was: http://www.ftsolutions.de

  4. #4
    Registriert seit
    Dec 2006
    Beiträge
    13
    Vielen Dank für die schnellen Antworten, ich habe mal beide Schlüsselwörter ('NOT DETERMINISTIC, u. 'FENCED') integriert, wobei ich mit 'NOT DETERMINISTIC' schon auch rumprobiert hatte. 'FENCE' hatte ich allerdings noch nicht ausprobiert.

    Auf jeden Fall schaut jetzt mein Procedure-Kopf folgendermaßen aus (siehe unten). Jetzt warte ich mal, wann dieser Fehler wieder auftritt...

    Evtl. ist bei höheren Versionsständen (wir haben V5R2) dieses Phänomen beseitigt!?

    -----------------------------------------
    create procedure vogtj/SPTUNNEL(
    IN actionname char(20)
    )

    result sets 1
    language sql
    NOT DETERMINISTIC
    FENCED

Similar Threads

  1. Stored Procedures unter V5R4
    By PeterKarsten in forum IBM i Hauptforum
    Antworten: 9
    Letzter Beitrag: 10-11-06, 09:40
  2. SQL Stored Procedure verschwindet
    By florian in forum IBM i Hauptforum
    Antworten: 10
    Letzter Beitrag: 17-05-06, 16:08
  3. DTAQs vs. Stored Procedures
    By us400 in forum NEWSboard Java
    Antworten: 6
    Letzter Beitrag: 21-01-06, 09:46
  4. V5R3: SQL Stored Procedures
    By Atomik in forum IBM i Hauptforum
    Antworten: 7
    Letzter Beitrag: 15-02-05, 13:53
  5. Wer hat Erfahrung mit Stored Procedures + AS/400?
    By KB in forum IBM i Hauptforum
    Antworten: 3
    Letzter Beitrag: 18-04-01, 15:30

Berechtigungen

  • Neue Themen erstellen: Nein
  • Themen beantworten: Nein
  • You may not post attachments
  • You may not edit your posts
  •