Re: [PHP-DB] Sybase CALL statement problems

2005-03-29 Thread Anthony Robins
I have checked my logfiles, and everything seems to be running
smoothly and error free.  The truncation occurs wether I use the
odbc_result_all function or something like:

WHILE( odbc_fetch_row( $CallTest ) ):
FOR( $ii = 1; $ii <= odbc_num_fields( $CallTest ); ++$ii ):
PRINT (odbc_field_name( $CallTest, $ii ) ." = ". odbc_result(
$CallTest, odbc_field_name( $CallTest, $ii ) ) . "");
ENDFOR;
PRINT ("");
ENDWHILE;


So it is not a problem with odbc_result_all.  I have compared the
source of the resulting page with the output buffering generated file
and it is definitely truncating, no <-- or  or
anything similar... In one case, the browser page source was 12,196
characters in length compared to 37,127 characters in the output
buffer file. 

As you said, there are some 'hackish' things that I have tried such
as tacking on several thousand characters of whitespace to the end of
the output, which still truncates, but ends up truncating in the
middle of the whitespace...  I refuse to resort to something like
this.

The parameters for mladselmeans? nothing too fancy, just passing it a
bunch of minimum and maximum values for various lookups and
calculations that the CALLed statement does...

Anthony Robins

 Original Message 
From: [EMAIL PROTECTED]
To: php-db@lists.php.net
Subject: Re: [PHP-DB] Sybase CALL statement problems
Date: Tue, 29 Mar 2005 09:33:53 -0600

>Anthony Robins wrote:
>> When retrieving ODBC results from Sybase SQL Anywhere 6 and 9 from
>a
>> CALLed procedure, the output to the browser is being arbitrarily
>> truncated. 
>> 
>> > $DataSourceUserID = "user";
>> $DataSourcePassword = "pass";
>> $DataSourceName = "source";
>> 
>> $ODBCConnect =
>>
>odbc_connect($DataSourceName,$DataSourceUserID,$DataSourcePassword);
>> $CallSQL = "CALL mladselmeans( '', 0, , 0, , 0,
>,
>> 'mladsite', 1 )";
>> $CallTest = odbc_exec( $ODBCConnect, $CallSQL );
>> odbc_result_all($CallTest);
>> ?>
>> 
>> The resulting output does contain proper data, but as I said, it
>> simply gets chopped off at a seemingly random point (I have had it
>> chop anywhere from 1500-25000 characters off).  The amount of
>> truncation seems to vary depending on the results of the CALL, and
>> when the results are the same, the truncation is the same.  Perhaps
>> the strangest thing is that I know for a fact that all of the data
>is
>> being returned by Sybase... If I use output buffering and send the
>> contents of the buffer to a file before the end of the script, all
>of
>> the data makes it into the file, but still not to the browser. 
>> Trying to free the odbc resource or close the connection results in
>> no output at all.
>
>A number of possibilities come to mind - some hackish unfortunately. 
>You  say with output buffering the contents make it into the file,
>but 
>not the web browser.  Have you checked your logfiles to see if there
>is 
>anything - perhaps the script is terminating early, etc.  Print 
>something after the table as well, see if that doesn't help.  It 
>certainly sounds like something is being buffered.  There are reports
>
>that this function doesn't return the total number of rows correctly,
>
>but nothing more on that as to whether that indicates a problem or
>not.
>
>http://www.php.net/manual/en/function.odbc-result-all.php
>
>Also - you may want to view the source, or open that output buffering
>
>generated file in a web browser - and see if the same problem
>persists. 
>  It could just be bad data inside the database that's causing for
>e.g. 
>- Martin Norland, Sys Admin / Database / Web Developer, International
>
>Outreach x3257
>The opinion(s) contained within this email do not necessarily
>represent 
>those of St. Jude Children's Research Hospital.
>
>-- 
>PHP Database Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] Sybase CALL statement problems

2005-03-29 Thread Anthony Robins
When retrieving ODBC results from Sybase SQL Anywhere 6 and 9 from a
CALLed procedure, the output to the browser is being arbitrarily
truncated. 



The resulting output does contain proper data, but as I said, it
simply gets chopped off at a seemingly random point (I have had it
chop anywhere from 1500-25000 characters off).  The amount of
truncation seems to vary depending on the results of the CALL, and
when the results are the same, the truncation is the same.  Perhaps
the strangest thing is that I know for a fact that all of the data is
being returned by Sybase... If I use output buffering and send the
contents of the buffer to a file before the end of the script, all of
the data makes it into the file, but still not to the browser. 
Trying to free the odbc resource or close the connection results in
no output at all.

ANY thoughts on this matter would be appreciated.

Anthony Robins
Using PHP 4.3.4 on Windows 2000 Server. 

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] ODBC Column Name Truncation

2004-09-09 Thread Anthony Robins
When retrieving ODBC results from Sybase SQL Anywhere 6 and 9, the
column names are being truncated to 31 characters. --



Result:
1: key - 4
2: a_really_long_name_that_is_long - 5
3: longer_name - 6

I expected #2 to have the name:
a_really_long_name_that_is_longer_than_31_characters

-- This happens even if the column name is simply specified using sql
'AS' (i.e. "select column as
a_really_long_name_that_is_longer_than_31_characters from crap" would
still return "a_really_long_name_that_is_long" as the column name).

Using PHP 4.3.4 on Windows 2000 Server. Have also tried on SUSE Linux
as well as with PHP 5.

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php