{ fn dateAdd} does not work

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
albourgz
Posts: 160
Joined: Wed 06 May 2009 12:17
Location: belgium

{ fn dateAdd} does not work

Post by albourgz » Mon 05 Sep 2016 09:24

using unidac 6.13, c++ builder xe10 seattle, oracle 12c.
UniQDateFunc is a TUniQuery.

Code: Select all

    UnicodeString s;
    UniQDateFunc->Active=false;
    UniQDateFunc->SQL->Text=L"select {fn DATEADD(hour,:1,:2) } from dual";
    UniQDateFunc->Prepare();
    UniQDateFunc->Params->Items[0]->AsInteger=1;
    UniQDateFunc->Params->Items[1]->AsDateTime=Now();
    UniQDateFunc->Active=true;
gives a run-time error. I tried to swap :1 and :2, no change.

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: { fn dateAdd} does not work

Post by AlexP » Fri 09 Sep 2016 13:22

Hello,

Thank you. We have reproduced and fixed this behavior. Currently, to solve the issue, it is enough to swap parameter types:

Code: Select all

    UnicodeString s;
    UniQDateFunc->Active=false;
    UniQDateFunc->SQL->Text=L"select {fn DATEADD(hour,:1,:2) } from dual";
    UniQDateFunc->Prepare();
    UniQDateFunc->Params->Items[0]->AsDateTime=Now(); 
    UniQDateFunc->Params->Items[1]->AsInteger=1;
    UniQDateFunc->Active=true;

Post Reply