You are here: Re: Failure of odbc_num_rows sometimes « PHP SQL « IT news, forums, messages
Re: Failure of odbc_num_rows sometimes

Posted by Hilarion on 11/28/05 14:01

> When I have an Sql statement of the form:
>
> SELECT LOC_ID,REPEAT('--',LEVELX)||NAMEX
> FROM is3.locations
> WHERE entity_id=2
> AND (inactive='N' OR inactive IS NULL)
> AND leftx BETWEEN 2 AND 983
> ORDER BY LEFTX
>
> odbc_num_rows returns -1. When I change the sql statement to:
>
> SELECT LOC_ID,CHAR(LEVELX)||' '||NAMEX
> FROM is3.locations
> WHERE entity_id=2
> AND (inactive='N' OR inactive IS NULL)
> AND leftx BETWEEN 2 AND 983
> ORDER BY LEFTX
>
> odbc_num_rows returns the correct result.
>
> Both statements work in the ADS development environment.
>
> The rdms is db2 udb v8.1.9 linux
>
> php is 4.4.0 with db2 compiled in
> './configure' '--prefix=/usr/local/php-4.4.0'
> '--with-apxs2=/usr/local/apache2.0.54/bin/apxs'
> '--with-ibm-db2=/db2home/db2inst1/sqllib'
> '--with-openssl=/usr/local/ssl-0.9.8'


Maybe it's a problem with "--" being a comment combination.
Try using one "-" instead of two, or concatenate them.

Hilarion

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация