views:

198

answers:

3

I got following question on an interview:
Which SQL mechanisms allow user to browse tables sequentially?

+2  A: 

"CURSOR" might be the word that you should google for.

xor_eq
Are there any other than cursor machanisms ?I got confused, because question was about 'mechanisms' not 'mechanism' :|
Tomek Tarczynski
I guess Martin already answered that.
xor_eq
+4  A: 

Cursor is a good example - but I don't think you could really argue that Cursors are truely a part of SQL - rather they just tend to come bolted in with procedural languages used on database servers - like pl/SQL and T-SQL.

You could also make an argument for Recordsets, Dynasets, DataTables and DataViews, but those aren't part of SQL itself either.

They might be referring to ORDER BY with a sequential field on the table, but if so, they've not phrased their question very well...

Martin.

Martin Milan
+1  A: 

We can use Cursors or While statement to achieve this:

Here is the example.. http://www.prepare4interview.com/1698/which-sql-mechanisms-allow-user-browse-tables-sequentially

Micheal George