Stored procedures with date parameters don't work 
Author Message
 Stored procedures with date parameters don't work

I have a stored procedure in SQL server 2000 that uses 3 parameters:


I call it from Clarion like this:

AFile{PROP:SQL} = 'noresultcall
sp_Convierte(&Store[IN],&ProcessDate[IN],&ErrorCode[OUT])'


in Clarion).

ProcessDate is a LONG, as all dates in Clarion are, the value inserted in
the form is 12/15/2000 and for some reason the date I got at the end of the
stored procedure is 12/19/2099 (preety bad hu?).

I also tried using:

DateField              STRING(8)
DateField_GROUP GROUP, OVER(DateField)
    DateField_DATE  DATE
    DateField_TIME  TIME
end

Sending &DateField (the string)
             &DateField_GROUP (the group)
             &DateField_DATE  DATE (the date part)

It returns an error in converting string (or date) to datetime.

Any help?
I'm in a hurry, so any advise will be more appreciated than usual.
Thanks.
Cap. Ariel Alvarez
C5.5-SQL Server 2000



Sat, 04 Oct 2003 04:09:56 GMT  
 Stored procedures with date parameters don't work
I got the answer already.

This posting is for anyone in the same situation than me.
Hope it helps.

Instead of sending a LONG, send a CSTRING(11), preloaded as follows:


That's all.
Remember to use the correct picture token as expected from de database (in

Also dont forget to bind and unbind your variables.

PUSHBIND
BIND('ProcessDateString',ProcessDateString)
BIND...any variable sent as a parameter
  do your thing here
UNBIND(ProcessDateString)
UNBIND...any variable sent as a parameter
POPBIND

Thanks anyway.
See you in my next brainlock.

Cap. Ariel Alvarez
C5.5-SQL Server 2000



Quote:
> I have a stored procedure in SQL server 2000 that uses 3 parameters:


> I call it from Clarion like this:

> AFile{PROP:SQL} = 'noresultcall
> sp_Convierte(&Store[IN],&ProcessDate[IN],&ErrorCode[OUT])'


(&ProcessDate
> in Clarion).

> ProcessDate is a LONG, as all dates in Clarion are, the value inserted in
> the form is 12/15/2000 and for some reason the date I got at the end of
the
> stored procedure is 12/19/2099 (preety bad hu?).

> I also tried using:

> DateField              STRING(8)
> DateField_GROUP GROUP, OVER(DateField)
>     DateField_DATE  DATE
>     DateField_TIME  TIME
> end

> Sending &DateField (the string)
>              &DateField_GROUP (the group)
>              &DateField_DATE  DATE (the date part)

> It returns an error in converting string (or date) to datetime.

> Any help?
> I'm in a hurry, so any advise will be more appreciated than usual.
> Thanks.
> Cap. Ariel Alvarez
> C5.5-SQL Server 2000



Sat, 04 Oct 2003 05:11:38 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Multi Component Key with Dates don't always work as easy as 1,2,3

2. Tcl Date Routines don't handle ISO date formats

3. AS/400 Stored Procedure Parameters

4. Call a SQL stored procedure using input and output parameters

5. Urgent: DCOracle2 + stored procedure parameters

6. Envy, don't store method source

7. Dolphin Applet's don't work...

8. match works, don't match doesn't

9. UNC's Still Don't Work?#$%

10. Using Oracle's stored procedures from Python

11. procedures - I just don't understand.

12. Data Hiding - A Procedure's First Parameter

 

 
Powered by phpBB® Forum Software