Article View: pl.comp.lang.delphi.bazy-danych
Article #82954Re: Delphi XE, Firebird 2.5.2, FIBPlus - błąd konwersji parametru zapytania.
From: Marcin G.
Date: Tue, 19 Jun 2018 09:53
Date: Tue, 19 Jun 2018 09:53
32 lines
2069 bytes
2069 bytes
Użytkownik "Marcin G." napisał w wiadomości grup
dyskusyjnych:5b28ca76$0$688$65785112@news.neostrada.pl...
Jest sobie taki kod:
FBMainQuery.SQL.Clear;
FBMainQuery.SQL.Add('SELECT SERVICE, LASTDT, FROM LASTUPDATE WHERE LASTDT <
CURRENT_TIMESTAMP - :IddleTime');
FBMainQuery.Params[0].AsFloat := AIddleTime / 60 / 24;
FBMainQuery.ExecQuery;
Generuje on błąd:
Incompatible column/host variable data type.
Dynamic SQL Error.
SQL error code = -303.
Conversion error from string "0.02083333333333333". //wartość przykładowa
Zapytanie ma pobierać rekordy starsze niż IddleTime sekund.
Co robię nie tak?
Próbowałem również:
...
FBMainQuery.Params[0].AsDateTime := AIddleTime / 60 / 24;
...
ale wtedy dostaję błąd np.:
Overflow occurred during data type conversion.Conversion error from string
"43270.398832917".
Użycie funkcji DATEADD rozwiązuje problem.
Pozdrawiam,
Marcin G.
Technical Details
Message-ID:
<5b28d283$0$591$65785112@news.neostrada.pl>Path:
mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!newsfeed2.atman.pl!newsfeed.atman.pl!goblin1!goblin.stu.neva.ru!newsfeed.neostrada.pl!unt-exc-02.news.neostrada.pl!unt-spo-a-02.news.neostrada.pl!news.neostrada.pl.POSTED!not-for-mailReferences:
<5b28ca76$0$688$65785112@news.neostrada.pl>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!newsfeed2.atman.pl!newsfeed.atman.pl!goblin1!goblin.stu.neva.ru!newsfeed.neostrada.pl!unt-exc-02.news.neostrada.pl!unt-spo-a-02.news.neostrada.pl!news.neostrada.pl.POSTED!not-for-mail From: "Marcin G." <sq9etc_usun_to_@poczta_usun_to_.onet.pl> Newsgroups: pl.comp.lang.delphi.bazy-danych References: <5b28ca76$0$688$65785112@news.neostrada.pl> In-Reply-To: <5b28ca76$0$688$65785112@news.neostrada.pl> Subject: Re: Delphi XE, Firebird 2.5.2, FIBPlus - błąd konwersji parametru zapytania. Date: Tue, 19 Jun 2018 11:53:04 +0200 MIME-Version: 1.0 X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Newsreader: Microsoft Windows Live Mail 15.4.3508.1109 X-MimeOLE: Produced By Microsoft MimeOLE V15.4.3508.1109 Lines: 33 Message-ID: <5b28d283$0$591$65785112@news.neostrada.pl> Organization: Telekomunikacja Polska NNTP-Posting-Host: 195.189.52.100 X-Trace: 1529401987 unt-rea-b-01.news.neostrada.pl 591 195.189.52.100:61259 X-Complaints-To: abuse@news.neostrada.pl Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit