"ed",
I'm not sure what gave you the impression that the FIRST_ROWS hint
worked that way, but the FIRST_ROWS hint doesn't doesn't work like
that... at all.
Hints are used for manipulating the execution behavior of the SQL, not
for manipulating the result set. Hints are often used during SQL tuning
sessions to help identify and diagnose execution behaviors that return
result sets faster than others. Some hints might become permanent
fixtures on the SQL (i.e. parallelism hints), while others are purely
for diagnostic purposes during the tuning process, and you don't want
them ending up in production long-term.
Here is a "hint" to solve your problem... but add this to your where
clause, because it is NOT an Oracle hint:
where rownum < 11
Alternatively, you can use a cursor in one of Oracle's programmatic
interfaces and just fetch the first ten tuples in a while loop, but I
honestly and constructively recommend that you wait until you get a
little more SQL under your belt before exploring programmatic
interfaces, hints, altering sessions, and altering databases. These are
advanced subjects where having solid SQL skills are very beneficial and
often required. You will only frustrate yourself (and probably lots of
others) if you jump into these other advanced topics without having the
solid SQL background to help you get through them.
Hope this helps!
-Richard
-----Original Message-----
From: ed
[mailto:oracledba-ezmlmshield-x62362700.[Email address protected]
Sent: Wednesday, August 31, 2005 7:45 AM
To: LazyDBA Discussion
Subject: first_rows(10)
I try to set hint /*+ FIRST_ROWS(10) */ for only first 10 records from
result sets, but oracle bring me always all records;
does I need to set something on session or database for use of this
hint?
--------
website: http://www.LazyDBA.com
Please don't reply to RTFM questions
Oracle documentation is here: http://tahiti.oracle.com
To unsubscribe: see http://www.lazydba.com/unsubscribe.html
To subscribe: see http://www.lazydba.com
By using this list you agree to these
terms:http://www.lazydba.com/legal.html
Oracle LazyDBA home page