Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Where can I get a complete list of all SQL Hints?

Re: Where can I get a complete list of all SQL Hints?

From: TM <tonym101_at_hotmail.com>
Date: 20 Jun 2003 15:27:49 -0700
Message-ID: <7b718442.0306201427.1b798ddb@posting.google.com>


wizofoz2k_at_yahoo.com.au (Nuno Souto) argued, wrongly, that DB2 UDB has hints...

> Really? So that stuff about:
> FOR READ or FETCH ONLY,

FOR READ is not a hint, but the ANSI SQL standard for defining a cursor to be read-only. FOR FETCH is just a synonym that does the same thing.

> FOR UPDATE
FOR UPDATE is not a hint, but the ANSI standard for defining a cursor to be updateable.

> FETCH FIRST n ROWS ONLY

OPTIMIZE FOR n ROWS is a soft limit that tells DB2 that you are likely to only want the first n rows of the result set, but does not prevent you fetching further rows if you change your mind. FETCH FIRST n ROWS ONLY is a hard limit that is DB2 direct syntactical equivalent of the ANSI SQL LIMIT TO n ROWS clause. It is not a hint and indeed alters the result set.

> is for what? Ad-hoc queries?

Some of these clauses apply only to cursors, but other than that - any query you like.

> Jeez...
>
> Cheers
> Nuno Souto
> wizofoz2k_at_yahoo.com.au.nospam

Jeez... well quite. You pretend to know something about databases, so it's amazing that you seem to be unaware of the existence and usefulness of LIMIT clauses, and don't recognize standard ANSI clauses FOR READ ONLY and FOR FETCH ONLY but instead somehow imagine these are DB2 hints! If you really work in the industry then I suggest you try to keep your ignorance a little less high profile.

Was this really the best you could do?

TM Received on Fri Jun 20 2003 - 17:27:49 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US