Re: query using index get no row?
Date: Fri, 18 Apr 2008 09:35:32 -0700
Message-ID: <1208536532.61527@bubbleator.drizzle.com>
perivoj_at_net.hr wrote:
> I had this two queries:
>
> select * from table where id = number;
> select /*+ NO_INDEX (table PK_IDX)*/ * from table where id = number;
>
> When query used index no row was returned. Index is on primary key
> column and status in user_indexes was 'VALID'.
>
> I rebuild index but problem is not fixed.
>
> I fixed problem with:
> alter index PK_IDX unusable;
> and then
> alter index PK_IDX rebuild;
>
> What was problem?
>
> Goran
Please post full and complete version number, operating system and your real DML. Not the phony statement you posted in your query.
SQL> CREATE TABLE TABLE (
2 testcol DATE);
CREATE TABLE TABLE (
*
ERROR at line 1:
ORA-00903: invalid table name
SQL> It should be further noted that ID is a reserved word and should never be used as a column name.
-- Daniel A. Morgan Oracle Ace Director & Instructor University of Washington damorgan_at_x.washington.edu (replace x with u to respond) Puget Sound Oracle Users Group www.psoug.orgReceived on Fri Apr 18 2008 - 11:35:32 CDT