| View previous topic :: View next topic |
| Author |
Message |
Rhea Grason Guest
|
Posted: Mon Apr 26, 2004 7:56 pm Post subject: Null in Stored Procedure Parameter For DateTime |
|
|
I am using Delphi 5 against Sybase SQLAnywhere 8.0.2 databases. I call a
stored procedure from my app that sometimes needs to pass a null value for a
datetime field. I have tried the suggested code like this but a datetime of
1899-12-30 00:00:00.000 is still sent instead of a null value. Is there any
way to actually get the value to be null? Thanks.
StoredProc_AddTessProduction.Params[7].Clear;
StoredProc_AddTessProduction.Params[7].Bound := true;
|
|
| Back to top |
|
 |
Bruce Michener Guest
|
Posted: Tue Apr 27, 2004 1:59 pm Post subject: Re: Null in Stored Procedure Parameter For DateTime |
|
|
On Mon, 26 Apr 2004 13:56:22 -0600, Rhea Grason
<rhea.grason (AT) beaverplastics (DOT) com> wrote:
| Quote: | I am using Delphi 5 against Sybase SQLAnywhere 8.0.2 databases. I call a
stored procedure from my app that sometimes needs to pass a null value
for a
datetime field. I have tried the suggested code like this but a datetime
of
1899-12-30 00:00:00.000 is still sent instead of a null value. Is there
any
way to actually get the value to be null? Thanks.
StoredProc_AddTessProduction.Params[7].Clear;
StoredProc_AddTessProduction.Params[7].Bound := true;
Have you tried defining a default value of Null in the stored procedure |
for this parameter and then only pass a value via Delphi when it is
something other than Null.
|
|
| Back to top |
|
 |
Rhea Grason Guest
|
Posted: Tue Apr 27, 2004 2:36 pm Post subject: Re: Null in Stored Procedure Parameter For DateTime |
|
|
Thanks, I thought of that after and it works.
"Bruce Michener" <bmichene (AT) boe (DOT) ca.gov> wrote
| Quote: | On Mon, 26 Apr 2004 13:56:22 -0600, Rhea Grason
[email]rhea.grason (AT) beaverplastics (DOT) com[/email]> wrote:
I am using Delphi 5 against Sybase SQLAnywhere 8.0.2 databases. I call
a
stored procedure from my app that sometimes needs to pass a null value
for a
datetime field. I have tried the suggested code like this but a datetime
of
1899-12-30 00:00:00.000 is still sent instead of a null value. Is there
any
way to actually get the value to be null? Thanks.
StoredProc_AddTessProduction.Params[7].Clear;
StoredProc_AddTessProduction.Params[7].Bound := true;
Have you tried defining a default value of Null in the stored procedure
for this parameter and then only pass a value via Delphi when it is
something other than Null.
|
|
|
| Back to top |
|
 |
|