[NEWSboard IBMi Forum]
  1. #1
    Registriert seit
    Apr 2008
    Beiträge
    83

    Fehlertext bei SQL

    Moin,

    ich hatte Probleme mit einem SQL-Statement, welche inzwischen aber gelöst sind. Der Fehler war SQL7008.
    Leider kann dieser Fehler mehrere Gründe haben (siehe unten).
    Ich habe hier im Forum das Statement "get diagnostics" gefunden. Das liefert mir aber nur den "message text".
    Kann man auch "cause text" und "recovery text" irgendwie ermitteln?

    Code:
    SQL7008
    Message Text:	&1 in &2 not valid for operation.
    
    Cause Text:	The reason code is &3. Reason codes are: 
    1 -- &1 has no members. 
    2 -- &1 has been saved with storage free. 
    3 -- &1 not journaled, no authority to the journal, or the journal state is 
    *STANDBY. Files with an RI constraint action of CASCADE, SET NULL, or SET 
    DEFAULT must be journaled to the same journal. 
    4 and 5 -- &1 is in or being created into production library but the user has 
    debug mode UPDPROD(*NO). 
    6 -- Schema being created, but user in debug mode with UPDPROD(*NO). 
    7 -- A based-on table used in creation of a view is not valid. Either the 
    table is program described table or it is in a temporary schema. 
    8 -- Based-on table resides in a different ASP than ASP of object being 
    created. 
    9 -- Index is currently held or is not valid. 
    10 -- A constraint or trigger is being added to an invalid type of table, 
    or the maximum number of triggers has been reached, or all nodes of the 
    distributed table are not at the same release level. 
    11 -- Distributed table is being created in schema QTEMP, or a view is being 
    created over more than one distributed table. 
    12 -- Table could not be created in QTEMP, QSYS, QSYS2, or SYSIBM because 
    it contains a column of type DATALINK having the FILE LINK CONTROL option.
    13 -- The table contains a DATALINK column or a LOB column that conflicts 
    with the data dictionary. 
    14 -- A DATALINK, LOB, or IDENTITY column cannot be added to a non SQL table. 
    15 -- Attempted to create or change an object using a commitment definition 
    in a different ASP.
    16 -- Sequence &1 in &2 was incorrectly modified with a CL command.
    17 -- The table is not usable because it contains partial transactions.
    
    Recovery Text:	Do one of the following based on the reason code: 
    1 -- Add a member to &1 (ADDPFM). 
    2 -- Restore &1 (RSTOBJ). 
    3 -- Start journaling on &1 (STRJRNPF), get access to the journal, or change 
    the journal state to *ACTIVE (CHGJRN). 
    4, 5, or 6 -- Perform a CHGDBG command with UPDPROD(*YES).
    7 -- Remove table names which identify files in QTEMP or program described 
    files. 
    8 -- Use tables in the same ASP.
    9 -- Use the EDTRBDAP command to change the sequence of the access path from 
    HELD to 1-99 or *OPN, or rebuild or delete the unique index or constraint. 
    10 -- Specify tables that are valid for constraints or triggers.
    11 -- Specify a schema other than QTEMP, or create the view over only one 
    distributed table.
    12 -- Specify a schema other than QTEMP, QSYS, QSYS2, or SYSIBM.
    13 -- Specify a schema that does not contain a data dictionary or remove 
    all DATALINK and LOB columns. 
    14 -- Specify an SQL table. 
    15 -- Specify an object in the same ASP as the current commitment definition 
    or end the current commitment definition.
    16 -- Specify a different sequence, or delete the data area associated with 
    sequence &1 in &2 and recreate the sequence. 
    17 -- See previous message in the job log.

  2. #2
    Registriert seit
    Aug 2003
    Beiträge
    1.508

  3. #3
    Registriert seit
    Aug 2001
    Beiträge
    2.873
    Da hilft halt nur der gute alte Retrieve Message bei dem der Error Text von Level 2 ermittelt wird.

    Die Fehlermeldungen sind in Message-File QSQLMSG hinterlegt.
    Die Message-Id (Schlüssel-Wort DB2_MSGID) und der Reason-Code (DB2_REASON_CODE) kann über GET DIAGNOSTICS ermittelt werden.

    Birgitta
    Birgitta Hauser

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

Similar Threads

  1. RPGLE - SQL
    By christian_lettner in forum NEWSboard Programmierung
    Antworten: 2
    Letzter Beitrag: 16-11-06, 10:15
  2. SQL - Cursor vernichten ?!?
    By FNeurieser in forum NEWSboard Programmierung
    Antworten: 3
    Letzter Beitrag: 11-10-06, 14:53
  3. SQL und OBJLCK
    By malzusrex in forum IBM i Hauptforum
    Antworten: 8
    Letzter Beitrag: 19-09-06, 11:04
  4. SQL - Fehler
    By Kaufmann in forum IBM i Hauptforum
    Antworten: 11
    Letzter Beitrag: 28-06-06, 14:11
  5. SQL .. for update of (RPG embedded SQL)
    By loeweadolf in forum NEWSboard Programmierung
    Antworten: 2
    Letzter Beitrag: 01-06-06, 09:43

Berechtigungen

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