Einzelnen Beitrag anzeigen

Nuclear-Ping
(Gast)

n/a Beiträge
 
#1

Fehlermeldung: Data truncated

  Alt 19. Jul 2007, 20:50
Datenbank: Advantage • Version: 7 • Zugriff über: TDataSet, TQuery
Hallo,

manche Kunden unserer Software bekommen beim Einfügen von Einträgen (die Texte und Bilder / Sounds enthalten (können)) in eine ADS-Datenbank folgende SQL-Fehlermeldung:

Zitat:
Fehler bei SQL-Abfrage : Error 7200 : AQE Error : State = 01004;
Native Error = 2102 ; [Extended Systems]
[Advanced SQL Engine] Data truncated
Die Hilfe dazu meint:
Zitat:
Problem: An internal buffer within the SQL engine was too small, and data was truncated when copied into it. The most likely cause of this error is the result of data conversions. For example if you set a DBF numeric field parameter with a double or a character value, it might overflow the field width or precision. The SQL engine returns this code as a warning. All updates still occur when this code is returned. For example, if an UPDATE statement is executed that assigns too many digits of precision to a numeric field, the 2102 code will be returned, but all updates on all applicable rows will still be performed.

Solution: Verify that the statement is using compatible data types.
Das ist die Abfrage:
Delphi-Quellcode:
function TDBModule.AddNewDatabaseItem (DBName: String; DatabaseData: TDatabaseData;
  var TreeNodeData: PTreeMenuEntry): Integer;
begin
  Result := 0;
  with AdsQuery, SQL do
    try
      Clear;

      Add ('INSERT INTO "' + DBName + ' DB" ' +
           ' (CategoryID, ' +
           ' Problem, ' +
           ' ProblemDescription, ' +
           ' Solution, ' +
           ' SolutionDescription, ' +
           ' SymbolType1, ' +
           ' Symbol1, ' +
           ' SymbolType2, ' +
           ' Symbol2) ' +
           'VALUES (' +
             #39 + DelphiEscapeString (DatabaseData.CategoryID) + #39 + ', ' +
             ':Problem, ' +
             ':ProblemDescription, ' +
             ':Solution, ' +
             ':SolutionDescription, ' +
             inttostr (Integer (DatabaseData.SymbolType1)) + ', ' +
             ':Symbol1, ' +
             inttostr (Integer (DatabaseData.SymbolType2)) + ', ' +
             ':Symbol2);');

      Prepare;

      ParamByName ('Problem').AsMemo := DatabaseData.Problem;
      ParamByName ('ProblemDescription').AsMemo := DatabaseData.ProblemDescription;
      ParamByName ('Solution').AsMemo := DatabaseData.Solution;
      ParamByName ('SolutionDescription').AsMemo := DatabaseData.SolutionDescription;

      if (DatabaseData.SymbolType1 <> stNoSymbol) then
        begin
          DatabaseData.Symbol1.Position := 0;
          ParamByName ('Symbol1').LoadFromStream (DatabaseData.Symbol1, ftBlob);
        end
      else ParamByName ('Symbol1').Clear;

      if (DatabaseData.SymbolType2 <> stNoSymbol) then
        begin
          DatabaseData.Symbol2.Position := 0;
          ParamByName ('Symbol2').LoadFromStream (DatabaseData.Symbol2, ftBlob);
        end
      else ParamByName ('Symbol2').Clear;

      ExecSQL;

      Result := LastAutoIncVal;

      Close;
      inc (TreeNodeData.ItemsCount);
    except
      ThrowSQLException (SQL[0]);
    end;
end;
So schaut die Tabelle aus:
SQL-Code:
/* Table Type of Data DB.adt is ADT*/
Create Table [Data DB](
   ID AutoInc,
   CategoryID Char( 32 ),
   Problem Memo,
   ProblemDescription Memo,
   Solution Memo,
   SolutionDescription Memo,
   SymbolType1 Short,
   Symbol1 Blob,
   SymbolType2 Short,
   Symbol2 Blob );

Create Unique Index "ID" on [Data DB]( ID );
Create Index "CATEGORYID" on [Data DB]( CATEGORYID );
Die Felder der DB sind imho auch korrekt, um mit den entsprechenden Daten umgehen zu können.

Problem ist, dass diese Fehlermeldung auf keiner unserer Testmaschinen bisher auftauchte.

Jemand eine Idee?
  Mit Zitat antworten Zitat