Skip to Content.
Sympa Menu

freetds - Re: PHP calling Stored Proc on MS-SQL 7 params bein g missinterpreted as dates

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Matt Kynaston" <matt AT online-canarias.com>
  • To: "TDS Development Group" <freetds AT franklin.oit.unc.edu>
  • Subject: Re: PHP calling Stored Proc on MS-SQL 7 params bein g missinterpreted as dates
  • Date: Fri, 21 Jun 2002 16:44:01 +0100


Trevor,

Your test sp fails both in Query Analyser and PHP/FreeTDS as is, but works
once I change the date format to: '20020620' - about the only way to safely
pass dates around when your server doesn't know if you're using US or
rest-of-the-world month/day positions.

Matt

> -----Original Message-----
> From: bounce-freetds-143964 AT franklin.oit.unc.edu
> [mailto:bounce-freetds-143964 AT franklin.oit.unc.edu]On Behalf Of Burgess,
> Trevor - HMS
> Sent: 21 June 2002 16:19
> To: TDS Development Group
> Subject: [freetds] Re: PHP calling Stored Proc on MS-SQL 7 params bein g
> missinterpreted as dates
>
>
> Thanks for your response,
>
> The script runs perfectly on a windows/apache/php combo and the
> sp has been
> used for the last 3 years by the paper reports. The @Item varchar(30) is
> never compared to a date although dates figure heavily in the sp.
>
> I have tried a script that contains parameters but no dates whatsoever and
> that works.
>
> Here is my little test:
> <?php
> if(!mssql_connect("SERVER1","wwwuser","XXXXXX")) die("Cannot Connect to
> Server");
> if(!mssql_select_db("WMS")) die("Cannot connect to Database");
> $sql = "EXEC ap_TEST";
> if(!$r = mssql_query($sql)) die("Error executing query");
> print "Rows: ".mssql_num_rows($r);
> $rowcount = 0;
> $h = "";
> while($row = mssql_fetch_array($r))
> { print $row[0]."<br>"; }
> ?>
> for the sp.
>
> CREATE PROCEDURE ap_TEST AS
> SELECT cCustomerID FROM SalesOrderHeader WHERE dtDeliveryDate =
> '20/6/2002'
>
> This fails too with the same error message.
>
> Thanks
>
> Trevor
>
> -----Original Message-----
> From: Bill Thompson [mailto:thompbil AT exchange.uk.ml.com]
> Sent: 21 June 2002 11:20
> To: TDS Development Group
> Subject: [freetds] Re: PHP calling Stored Proc on MS-SQL 7 params being
> missinterpreted as dates
>
>
> Hi Trevor,
>
> > I am using mssql_* in PHP on my linux box to talk to our MS-SQL server
> >
> ...MS-SQL server...
>
> > Error Message:
> > Warning: Sybase error: The conversion of a char data type to a datetime
> > data type resulted in an out-of-range datetime value. (severity 16) in
> > /www/reports.priv/htdocs/general/R0013.php on line 129
> >
>
> Sybase error ?
>
> This looks to me to be a server side error message being printed out...
> I think I'd need to see the source of your stored procedure...
>
> Bill
>
>
> ---
> You are currently subscribed to freetds as: [trevor.burgess AT haysdx.co.uk]
> To unsubscribe, forward this message to
> $subst('Email.Unsub')
>
>
> **********************************************************************
> This message (including any attachments) is confidential and may be
> legally privileged. If you are not the intended recipient, you should
> not disclose, copy or use any part of it - please delete all copies
> immediately and notify the Hays Group Email Helpdesk at
> email.helpdesk AT hays.plc.uk
> Any information, statements or opinions contained in this message
> (including any attachments) are given by the author. They are not
> given on behalf of Hays unless subsequently confirmed by an individual
> other than the author who is duly authorised to represent Hays.
>
> A member of the Hays plc group of companies.
> Hays plc is registered in England and Wales number 2150950.
> Registered Office Hays House Millmead Guildford Surrey GU2 4HJ.
> **********************************************************************
>
>
> ---
> You are currently subscribed to freetds as: [matt AT online-canarias.com]
> To unsubscribe, forward this message to
> $subst('Email.Unsub')






Archive powered by MHonArc 2.6.24.

Top of Page