Change:
CF_SQL_DATE

To:
CF_SQL_TIMESTAMP

And make sure that you pass in ODBC formatted datetime strings OR you
set the Null attribute to True/yes, like this:

.... Before calling CFSTOREDPROC ...

<cfscript>
If (IsDate(request.start_date)) {
    request.start_date = CreateODBCDateTime(request.start_date);
}
If (IsDate(request.end_date)) {
    request.end_date = CreateODBCDateTime(request.end_date);
}
</cfscript>

...

<cfprocparam type="InOut"
             cfsqltype="CF_SQL_TIMESTAMP"
             dbvarname="start_date"
         variable="start_date"
             value="#request.start_date#"
             null="#IsDate(request.start_date)#">

<cfprocparam type="InOut"
             cfsqltype="CF_SQL_DATE"
             dbvarname="end_date"
        variable="end_date"
             value="#request.end_date#"
             null="#IsDate(request.end_date)#">


And in case you were wondering, CF_SQL_TIMESTAMP does not map to MS SQL
Server's timestamp datatype. CF_SQL_DATE and CF_SQL_TIME do not work
with the provided MS SQL drivers that came with ColdFusion server.

Yeah. It was pretty "fun" trying to figure this bug out the first time I
found it many many moons ago...

----------------------------
James Ang
Programmer
MedSeek, Inc.
[EMAIL PROTECTED]






-----Original Message-----
From: Owens, Howard [mailto:[EMAIL PROTECTED]] 
Sent: Monday, January 13, 2003 5:42 PM
To: CF-Talk
Subject: RE: StoreProc Driver question


OK, follow up to my previous post ... I ran a test procedure that
stripped
it down to just a bare select query ... and it ran, so it's not a
"driver
problem" per se.

There must be an error in my code ... if anybody has any tips to pass
along
... here's my code:


<cfset request.start_date="1/1/80">
<cfset request.end_date=dateformat(now(), "m/d/yy")>

<cfstoredproc procedure="testProcedure"
              datasource="#request.dsn#"
              returncode="no">
                  
<cfprocparam type="InOut"
             cfsqltype="CF_SQL_DATE"
             dbvarname="start_date"
         variable="start_date"
             value="#request.start_date#"
             null="No">

<cfprocparam type="InOut"
             cfsqltype="CF_SQL_DATE"
             dbvarname="end_date"
        variable="end_date"
             value="#request.end_date#"
             null="No">

<cfprocresult name="ArchiveDates"
              resultset="1">


</cfstoredproc>


> -----Original Message-----
> From: Owens, Howard [SMTP:[EMAIL PROTECTED]]
> Sent: Monday, January 13, 2003 5:19 PM
> To:   CF-Talk
> Subject:      StoreProc Driver question
> 
> I'm trying to use CFSTOREDPROC for the first time, and I'm getting
this
> error:
> 
> [Microsoft][ODBC SQL Server Driver]Optional feature not implemented
> 
> I'm running SQL Server 2000 Developers Edition on a Win2K machine ... 
> 
> Can't I use storedprocs with the developer edition?  Am I missing some
> driver I should install? What the hell is going on!!! 
> 
> H.
> 
>                               

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Get the mailserver that powers this list at http://www.coolfusion.com

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to