BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Null in Stored Procedure Parameter For DateTime

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (SQL Servers)
View previous topic :: View next topic  
Author Message
Rhea Grason
Guest





PostPosted: Mon Apr 26, 2004 7:56 pm    Post subject: Null in Stored Procedure Parameter For DateTime Reply with 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;


Back to top
Bruce Michener
Guest





PostPosted: Tue Apr 27, 2004 1:59 pm    Post subject: Re: Null in Stored Procedure Parameter For DateTime Reply with quote



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





PostPosted: Tue Apr 27, 2004 2:36 pm    Post subject: Re: Null in Stored Procedure Parameter For DateTime Reply with quote



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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (SQL Servers) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.