Einzelnen Beitrag anzeigen

Ascuriah

Registriert seit: 6. Okt 2010
52 Beiträge
 
#15

AW: Tabellenspalten von FreeTables in DataDictionary kopieren

  Alt 20. Okt 2010, 10:28
Hey ho

Ich habe in meiner QuellTabelle ein Feld "Buchubgsdatum" welches vom Typ Timestamp ist. Dieses Feld soll aber genauso in meine neue Tabelle eingefügt werden. Habe schon mit Variant, String, DateTime alles mögliche getestet, aber komme einfach ned auf den Grünenzweig. Hier der Code:

Delphi-Quellcode:
begin
     adsconnection1 := TAdsConnection.Create(nil);
     adsconnection1.AdsServerTypes := [stADS_REMOTE];
     adsconnection1.ConnectPath := 'C:\OLAP\OLAP_DICTIONARY\OLAP_DICTIONARY.ADD';
     adsconnection1.Username := 'Adssys';

     qryOlap := TAQuery.Create(nil);
     qryOlap.AdsConnection := adsconnection1;

     qryFibu := TAQuery.Create(nil);
     qryFibu.AdsConnection := Connection;
     qryFibu.SQL.Add('select * from [C:\ag32ads\AFLDaten\K1\M13\01.01.2007-31.12.2007\agf_kbu]');
     qryFibu.Open;
     qryFibu.First;
     while not qryFibu.Eof do
     begin
         buchungsdat_TS := qryFibu.FieldByName('KBU_BUCHUNGSDATUM').AsString;

         sInsert := 'insert into olap_fibu_daten (Buchungsdatum) values(' + buchungsdat_TS + ')';

         qryOlap.SQL.Clear;
         qryOlap.SQL.Add(sInsert);
         qryOlap.ExecSQL;

         qryFibu.Next;
     end;

     qryFibu.Close();
     FreeAndNil(qryFibu);

end;
Und Fehlermeldung erhalten ich folgende:
Code:
Erste Gelegenheit für Exception bei $754D9617. Exception-Klasse EADSDatabaseError mit Meldung 'Error 7200: AQE Error: State = 42000;  NativeError = 2116; [iAnywhere Solutions][Advantage SQL Engine]Malformed number: 01.01 -- Location of error in the SQL statement is: 175 There was a problem parsing the value list in the INSERT INTO statement.'. Prozess OlapUI.exe (4608)
  Mit Zitat antworten Zitat