No Tobias,

you are partitially wrong...
Zend_Db_Select (not the Zend_Db_Table_Select class) does support the Limit clause.
I am using it with the PDO adapter in a project of mine.
To have it working you MUST set a orderung  before using limit.

So Jaruz can eighter use the Zend_Db_Select, or wait until Limit is integrated into Zend_Db_Table_Select.

Greetings
Thomas Weidner, I18N Team Leader
http://www.thomasweidner.com


----- Original Message ----- From: "Tobias Gies" <[EMAIL PROTECTED]>
To: "JARUZ" <[EMAIL PROTECTED]>
Cc: <[email protected]>
Sent: Monday, March 03, 2008 11:56 AM
Subject: Re: [fw-general] Zend Db Select limit broken for MSSQL?


Hey Jaruz,

Ms sql does not support the LIMIT clause and ZF does not emulate this.
There is, however, a workaround for this. Just google for "mssql limit clause" to find it. You might want to extend Zend_Db_Table to incorporate that one.

Best regards,
Tobias

--
Sent from my iPhone

Am 03.03.2008 um 11:18 schrieb JARUZ <[EMAIL PROTECTED]>:


Hi,

I have a very simple EventLogs extends Zend_Db_Table_Abstract class.  It
works fine except when I want to LIMIT the results on MSSQL:

$eventLogs = new EventLogs();
$select = $eventLogs->select();
$select->order('eventlog_timestamp DESC');
$select->limit(20, 10);

when I echo $select it shows:

SELECT "logs_event".* FROM "logs_event" ORDER BY "eventlog_timestamp" DESC
SELECT * FROM (SELECT TOP 10 * FROM () AS inner_tbl) AS outer_tbl

That of course results in an Incorrect Syntax error from the MSSQL server.

If I remove $select->limit(20, 10); the query works just fine.


Antonio
--
View this message in context: http://www.nabble.com/Zend-Db-Select-limit-broken-for-MSSQL--tp15799936s16154p15799936.html
Sent from the Zend Framework mailing list archive at Nabble.com.


Reply via email to