D7 E - Stored procedur ewith datetime parameters
Posted: Sat 20 Apr 2013 15:23
Hi, All.
I've a strange delphi exception calling a stored procedure with datetime parameters.
I tried a lot of different cases without any positive result.
See examples below:
CREATE PROCEDURE `JNTEST`(
in ASTARTDATE DATETIME,
OUT ASLADATETIME DATETIME)
BEGIN
SET ASLADATETIME = SYSDATE();
END$$
CREATE PROCEDURE `JNTEST2`(
in ASTARTDATE DATETIME)
BEGIN
declare x int;
set x = 0;
END$$
When I try to call it using this delphi sintax:
proc.Params.ParamByName('ADateStart').AsDateTime := Now;
proc.execproc;
delphi raises an exception "invalid value to datetime encode".
Using debugger, I saw that something in dbx crashes when application tries to set parameters value. If I don't set value or write a code like this:
proc.Params.ParamByName('ADateStart').Clear;
proc.execproc;
I've not exceptions.
Note that mysql database version is 5.1 and server is running on debian virtual machine.
Thanks for any suggestion.
Best
I've a strange delphi exception calling a stored procedure with datetime parameters.
I tried a lot of different cases without any positive result.
See examples below:
CREATE PROCEDURE `JNTEST`(
in ASTARTDATE DATETIME,
OUT ASLADATETIME DATETIME)
BEGIN
SET ASLADATETIME = SYSDATE();
END$$
CREATE PROCEDURE `JNTEST2`(
in ASTARTDATE DATETIME)
BEGIN
declare x int;
set x = 0;
END$$
When I try to call it using this delphi sintax:
proc.Params.ParamByName('ADateStart').AsDateTime := Now;
proc.execproc;
delphi raises an exception "invalid value to datetime encode".
Using debugger, I saw that something in dbx crashes when application tries to set parameters value. If I don't set value or write a code like this:
proc.Params.ParamByName('ADateStart').Clear;
proc.execproc;
I've not exceptions.
Note that mysql database version is 5.1 and server is running on debian virtual machine.
Thanks for any suggestion.
Best