Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sybase Adaptive Server IQ can't SELECT *, always limited to 30?

I've this problem with a Sybase IQ database (version SELECT @@version shows Adaptive Server IQ/12.5.0/0306) using the PHP SQL Anywhere extension.

I can't select all rows, i.e. SELECT * from anytable always returns 30 rows.

The only workaround I've found is using SELECT TOP 1000 * from anytable (maximum is 32767) but there are certain situations where I need all rows.

Any help is much appreciated.

EDIT: example script (much like the documentation)

$conn = sasql_connect("HOST=host:port;DBN=dbn;UID=uid;PWD=pwd");
if (!$conn) { echo "Connection failed."; die(); }

$result = sasql_query($conn, "SELECT * FROM dba.anytable" );
sasql_result_all($result); // display 30 rows in a formatted table
sasql_free_result($result);
sasql_disconnect($conn);

EDIT: specs of both machines where I'm experiencing the same exact problem:

Development machine:

  • Windows 7 x64
  • PHP 5.4.23 TS x86
  • SAP SQL Anywhere PHP Module for PHP 5.4
  • SAP SQL Anywhere Database Client 12.0.1.4134

Production sever:

  • CentOS 6.6 x64
  • PHP 5.5.23 NTS (x86_64 as per YUM)
  • SAP SQL Anywhere PHP Module for PHP 5.5
  • SAP SQL Anywhere Database Client 12.0.1.4127
like image 587
gremo Avatar asked Aug 07 '15 08:08

gremo


1 Answers

Probably a stupid question, but just to be sure.

Did you check in Client --> Tools -> Sybase IQ -> Maximum number of rows to display.

(sry for posting this as an answer, but i dont have enough rep to ask you in comments.) Cheers

like image 113
theweeknd Avatar answered Nov 10 '22 05:11

theweeknd