Zero Date converted to NULL
Posted: Mon 30 May 2016 05:25
Hello,
we are using Ver 7.01 of "dbExpress driver for SQL Server" with "Embarcadero Delphi XE3".
I have a stored procedure defined in SQL Server with a single DATETIME parameter.
When I call that stored procedure passing the zero date value for the parameter ('30.12.1899') that value is transformed to NULL for the parameter when DevArt driver produces the final SQL script for the SQL Server.
Resulting script reaching the SQL server is
Why?
What I expect is:
exec [AAA] '30.12.1899'
The standard Delphi driver is behaving just as I expect.
Is this an optional behaviour of DevArt driver?
we are using Ver 7.01 of "dbExpress driver for SQL Server" with "Embarcadero Delphi XE3".
I have a stored procedure defined in SQL Server with a single DATETIME parameter.
When I call that stored procedure passing the zero date value for the parameter ('30.12.1899') that value is transformed to NULL for the parameter when DevArt driver produces the final SQL script for the SQL Server.
Code: Select all
-- stored procedure definition --
ALTER PROCEDURE [dbo].[AAA](
@BBB DATETIME
)
-- Delphi code--
-- declarations --
sqlcDevArt: TSQLConnection;
sp: TSQLStoredProc;
d: TDateTime;
-- code --
sqlcDevArt.Close;
d := EncodeDate(1899, 12, 30);
sp.ParamByName('BBB').Value := d;
sp.ExecProc;
Code: Select all
exec [AAA] NULL
What I expect is:
exec [AAA] '30.12.1899'
The standard Delphi driver is behaving just as I expect.
Is this an optional behaviour of DevArt driver?