MySQL Forums
Forum List  »  InnoDB

OFFSET
Posted by: Faeroth Farenath
Date: March 22, 2008 11:42AM

Hello,

SQL_RESET(1, "@count"); // Array reset.
							
query_sql "SELECT count(`nameid`) FROM `inventory` WHERE `char_id` = '" + @char_id[@c]+ "'", @count; // Getting the amount of datasets. Works!

set @current, 0; // OFFSET count reset.

while(@current <= @count[0]) { // As long as there are datasets remaining.

	SQL_RESET(2, "@nameid", "@amount"); // Array reset.

	query_sql "SELECT `nameid` , `amount` FROM `inventory` WHERE `char_id` = '" + @char_id[@c] + "' LIMIT '" + @current + "' OFFSET 127", @nameid, @amount; // Does not work!
		
	set @current, @current + 127; // Next time start 127 onward.

	for( set @i, 0; @i < getarraysize(@nameid); set @i, @i + 1 )

		mes @nameid[@i] + " -> " + @amount[@i]; // Return the datasets. Does not work!

	next; // Ignore this.

}


That's the idea:
In this script language, there is a limit of 127 indexes for the arrays.
Therefore I wanted to let MYSQL get only 127 datasets and the next time the following 127.
The first MYSQL-Query works fine, but the second with the OFFSET does not.
I guess I did not understand OFFSET correctly...

Thanks in advance!

Options: ReplyQuote


Subject
Views
Written By
Posted
OFFSET
12531
March 22, 2008 11:42AM
3441
July 21, 2008 05:22AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.