Skip to Content.
Sympa Menu

freetds - Re: [freetds] Feature request

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Shahryar G. Hashemi" <shahryar AT n2h2.com>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] Feature request
  • Date: Tue, 27 May 2003 09:41:43 -0700 (PDT)

Is there no way in PHP to tell it to delete all white spaces from a variable?

I know you can do an rtrim() function to remove any blank characters from a
variable. I do not know if that helps.

Shahryar

On Tue, 27 May 2003, Laurent Papier wrote:

> Date: Tue, 27 May 2003 18:37:38 +0200
> From: Laurent Papier <papier AT sdv.fr>
> Reply-To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
> To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
> Subject: Re: [freetds] Feature request
>
> On 22 May 2003 21:44:39 +0200
> Frediano Ziglio <freddyz77 AT tin.it> wrote:
>
> > What library are you using ?
> > Can you describe when different behavior occur ?
> > You can issue a "SET ANSI_PADDING ON/OFF" command...
>
> We are using Apache/PHP 4.2.3 (compiled with --with-sybase-ct) and SQLServer
> 2000.
>
> We use the following code:
> <?php
> // FreeTDS
> $link = mssql_connect('db','user','pass');
> //mssql_query("set ANSI_PADDING OFF");
>
> mssql_query("CREATE TABLE tab ( col CHAR(16) not null )");
> mssql_query("INSERT INTO tab VALUES ('hello')");
> $r = mssql_query("SELECT col FROM tab");
> $line = mssql_fetch_row($r);
> print "'$line[0]', size =". strlen($line[0]) . "\n";
> mssql_query("DROP TABLE tab");
>
> mssql_close($link);
> ?>
>
>
> 'ANSI_PADDING' not defined produce this output:
>
> - with sybase 11.9.2: 'hello', size =5
> - with FreeTDS 0.60: 'hello ', size =16
>
> 'SET ANSI_PADDING ON' produce this output:
>
> - with sybase 11.9.2: 'hello', size =5
> - with FreeTDS 0.60: 'hello ', size =16
>
> 'SET ANSI_PADDING OFF' produce this output:
>
> - with sybase 11.9.2: 'hello', size =5
> - with FreeTDS 0.60: 'hello ', size =16
>
>
> After digging in docs, we found that FreeTDS behave the right way and that
> sybase always trim CHAR column. Our request is to make FreeTDS behave like
> the
> buggy sybase driver, with a runtime or compile time option, and always trim
> a
> CHAR column result.
>
> We can also do it in PHP, but we have several hundred of web sites writen
> with
> the sybase driver ...
>
> Thanks for your help.
>

--
Shahryar Ghazneini Hashemi | Cell Phone: +1 206 604-7852
DBA - Operations Group | Telephone: +1 206 834-1739
N2H2 Inc. | Pager: +1 206 609-6154
900 4th Avenue Suite #3600 | FAX: +1 206 336-2971
Seattle, WA 98164 U.S.A. | E-MAIL: shahryar AT n2h2.com
==============================================================================





Archive powered by MHonArc 2.6.24.

Top of Page