AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Datenbanken Delphi Fibplus Batch Datenimport Problem

Fibplus Batch Datenimport Problem

Ein Thema von manfred_h · begonnen am 28. Jul 2010 · letzter Beitrag vom 30. Jul 2010
Antwort Antwort
Seite 1 von 2  1 2   
manfred_h

Registriert seit: 4. Nov 2005
Ort: Basel
442 Beiträge
 
Delphi XE2 Enterprise
 
#1

Fibplus Batch Datenimport Problem

  Alt 28. Jul 2010, 10:45
Datenbank: Firebird • Version: 2.1 • Zugriff über: Fibplus
Hallo zusammen

in meiner Anwendung besteht die Möglichkeit Daten mit verschiedenen
Computer manuell abzugleichen. Dies funktioniert auch einwandfrei.
Neu ist die Datenbank erweitert worden und nun bestehen Probleme Daten die von der "alten" DB sind in die neue zu integrieren.

Der Import erfolgt so:


> z.B. anstelle von
alt: ( Q_TEST ist in neu nicht vorhanden )
Code:
  sql_string_table   := ( 'INSERT INTO HOTEL ( ID, C_NO, CITY, TEL, FAX, EMAIL, HOMEPAGE, Q_TEST )' +
                           'values ( :ID, :C_NO, :CITY, :TEL, :FAX, :EMAIL, :HOMEPAGE, :Q_TEST )');
  //
neu: ( zusätzlich sind die Felder POS_LAT, POS_LNG )
Code:
  sql_string_table   := ( 'INSERT INTO HOTEL ( ID, C_NO, CITY, POS_LAT, POS_LNG, TEL, FAX, EMAIL, HOMEPAGE )' +
                           'values ( :ID, :C_NO, :CITY, :POS_LAT, :POS_LNG, :TEL, :FAX, :EMAIL, :HOMEPAGE )');
danach ( ein Auszug )
Delphi-Quellcode:
      with Q_import do
      begin
        Close;
        SQL.Text :=( sql_string_table );
        BatchInputRawFile(db_dir + 'exchange\'+ file_name + '.fibplus');
        frm_import_export.log_window_1.Lines.Add('*** Import ***');
        frm_import_export.log_window_1.Lines.Add(db_dir + 'exchange\');
        frm_import_export.log_window_1.Lines.Add(file_name + '.fibplus');
        Close;
        frm_import_export.ProgressBar_imp_exp.Position := 30;
        if sql_string_table_d > 'then
        begin
          SQL.Text :=( sql_string_table_d );
          BatchInputRawFile(db_dir + 'exchange\'+ file_name +'_d.fibplus');
          frm_import_export.log_window_1.Lines.Add(file_name + '_d.fibplus');
          Close;
        end;
        frm_import_export.ProgressBar_imp_exp.Position := 60;
Die Fehlermeldung schlussendlich ist folgende:
Zitat:
First chance exception at $7555B727. Exception class EFIBInterBaseError with message 'DM.Q_import:
Arithmetic overflow or division by zero has occurred.Arithmetic exception, numeric overflow, or string truncation.
Bin für Tipps dankbar
Manfred
  Mit Zitat antworten Zitat
alex517

Registriert seit: 23. Nov 2004
Ort: Bernau b. Berlin
272 Beiträge
 
Delphi XE5 Enterprise
 
#2

AW: Fibplus Batch Datenimport Problem

  Alt 28. Jul 2010, 14:54
Hab BatchInput/BatchOutput selbst noch nicht verwendet deshalb nur eine Vermutung.
Das Import-File hat noch die alte Struktur und passt deshalb zum nicht zum neuen Insert-Statement.
Entweder ein zum Import-File passendes Insert-Statement verwenden oder
evtl. oder hilft das weiter:
devguide1.pdf
Zitat:
Batch processing
Delphi-Quellcode:
procedure BatchOutputRawFile(const FileName:string;Version:integer=1);
procedure BatchToQuery(ToQuery:TFIBQuery; Mappings:TStrings);
The Version parameter is responsible for format compatibility with old file versions, created
by FIBPlus BatchOutputXXX method. If Version = 1, FIBPlus uses an old principle of work
with file versions: the external file keeps data ordered by SQL query fields. It is supposed that on
reading data saved by the BatchInputRawFile method, parameters will have the same order in the
reading SQL. The number of TpFIBQuery fields (the source of the data) must coincide to the
number of TpFIBQuery parameters which will read the data. For string fields it is important to
have the same length for the field being written and for the reading parameter whereas their
names can differ.
If Version = 2, FIBPlus uses a new principle of writing data. Besides the data, the file also
keeps system information about fields (name, type and length). On reading the data, it will be
chosen by similar names. The order and number of fields in the writing TpFIBQuery can differ
from those of parameters in the reading TpFIBQuery. Their types and length can also differ.
Only names must coincide.
Alexander
  Mit Zitat antworten Zitat
manfred_h

Registriert seit: 4. Nov 2005
Ort: Basel
442 Beiträge
 
Delphi XE2 Enterprise
 
#3

AW: Fibplus Batch Datenimport Problem

  Alt 28. Jul 2010, 15:35
Hallo Alex

verwende bereits FIBPlus BatchOutputXXX method Version = 2
Zitat:
Entweder ein zum Import-File passendes Insert-Statement verwenden
Habe ich auch schon versuch erhalte aber trotzdem die Fehlermeldung:
Zitat:
First chance exception at $7555B727. Exception class EFIBInterBaseError with message 'DM.Q_import:
Arithmetic overflow or division by zero has occurred.Arithmetic exception, numeric overflow, or string truncation.
Danke auf jeden Fall für Deinen Tipp.

Shalom
Manfred
  Mit Zitat antworten Zitat
mkinzler
(Moderator)

Registriert seit: 9. Dez 2005
Ort: Heilbronn
39.851 Beiträge
 
Delphi 11 Alexandria
 
#4

AW: Fibplus Batch Datenimport Problem

  Alt 28. Jul 2010, 15:37
Stimmen die Codepage/locale Einstellungen?
Markus Kinzler
  Mit Zitat antworten Zitat
manfred_h

Registriert seit: 4. Nov 2005
Ort: Basel
442 Beiträge
 
Delphi XE2 Enterprise
 
#5

AW: Fibplus Batch Datenimport Problem

  Alt 28. Jul 2010, 16:44
Stimmen die Codepage/locale Einstellungen?
Sorry wo kann ich das nachschauen...
Habe bei der DB Anbindung meines Wissens nichts geändert.
Ausser der Umstellung von Firebird 1.5 auf 2.1.
  Mit Zitat antworten Zitat
mkinzler
(Moderator)

Registriert seit: 9. Dez 2005
Ort: Heilbronn
39.851 Beiträge
 
Delphi 11 Alexandria
 
#6

AW: Fibplus Batch Datenimport Problem

  Alt 28. Jul 2010, 16:46
Was steht den bei der Connection drinnen und was bei den Feldern in der DB?
Markus Kinzler
  Mit Zitat antworten Zitat
manfred_h

Registriert seit: 4. Nov 2005
Ort: Basel
442 Beiträge
 
Delphi XE2 Enterprise
 
#7

AW: Fibplus Batch Datenimport Problem

  Alt 28. Jul 2010, 16:52
Was steht den bei der Connection drinnen und was bei den Feldern in der DB?
Zitat:
with DM.DB_Gideons do
begin
Connected := False;
DBParams.Clear;
DBParams.Add ('lc_ctype=UNICODE_FSS');
DBParams.Add ('user_name=sysdba');
DBParams.Add ('password=masterkey');
LibraryName := app_dir +('fbclient.dll');
DatabaseName := db_dir +('GIDEONS_DB.FDB');
Connected := True;
end;
Die Verbindung klappt bei beiden Versionen ohne Probleme.
Lediglich der Import in die neue Version ist Problematisch.
Neu wird jetzt CopyCat für den Abgleich verwendet. Aber alle
Installationen müssen zuerst umgestellt werden.

Manfred
  Mit Zitat antworten Zitat
mkinzler
(Moderator)

Registriert seit: 9. Dez 2005
Ort: Heilbronn
39.851 Beiträge
 
Delphi 11 Alexandria
 
#8

AW: Fibplus Batch Datenimport Problem

  Alt 28. Jul 2010, 16:53
Sind denn alle Char/Varchar Felder auch UNICODE_FSS?
Markus Kinzler
  Mit Zitat antworten Zitat
manfred_h

Registriert seit: 4. Nov 2005
Ort: Basel
442 Beiträge
 
Delphi XE2 Enterprise
 
#9

AW: Fibplus Batch Datenimport Problem

  Alt 28. Jul 2010, 16:59
Ja bei beiden DB's.
  Mit Zitat antworten Zitat
Benutzerbild von Chemiker
Chemiker

Registriert seit: 14. Aug 2005
1.858 Beiträge
 
Delphi 11 Alexandria
 
#10

AW: Fibplus Batch Datenimport Problem

  Alt 28. Jul 2010, 20:03
Hallo manfred_h,

Zitat von manfred_h:
Ausser der Umstellung von Firebird 1.5 auf 2.1.
Hast Du die alten Daten in FB 1.5 und die neuen sollen auf FB 2.1? Wenn das so ist könnte vielleicht ein BackUp der alten DB (FB 1.5) und anschließend ein Restore auf die neue DB (FB 2.1) helfen. Anschließend noch mal Versuchen die DB zu ändern.

Bis bald Chemiker
wer gesund ist hat 1000 wünsche wer krank ist nur einen.
  Mit Zitat antworten Zitat
Antwort Antwort
Seite 1 von 2  1 2   

Themen-Optionen Thema durchsuchen
Thema durchsuchen:

Erweiterte Suche
Ansicht

Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 05:06 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz