var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: determine Cursor length / without FETCH ?????
I need to retrieve one random tuple from a big set of tuples returned by a
certain query. So my question is:
How can I find out the number of tuples returned by cursor, without actually
FETCHing ALL? (So I can MOVE then to that location and just FETCH 1).
I am not sure if I have understood your problem. Anyway here goes my advice.
If you want to select a random tupla, first of all you need to know how many of them there are. To achieve this write:
select count(*) from table where conditions;
Then get a random number between 1 and the number you got with the previous query. Execute the fetch command inside a loop and stop it when you reach the tupla you got with the random number.
A faster way is to ensure all tuplas got an unique id from 1 to ..., so when you get the random number, you can select the tupla with that id.
Hope this helps.