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: select * from <table_name> where 1=2

Re: select * from <table_name> where 1=2

From: C. <c_ferguson_at_rationalconcepts.com>
Date: Sat, 10 Jul 1999 11:23:54 -0700
Message-ID: <37878FB8.5274A49E@rationalconcepts.com>


Sorry for jumping into this one so late, but instead of using the select statement, why don't you use the DatabaseMetaData class (java.sql.DatabaseMetaData) to obtain the information you need?

Cindy

Michael Ho wrote:

> The 1=2 statement will return a false condition when oracle fetch record, so
> oracle actually won't perform db get, no i/o, no performance issue.
>
> The full scan is explained because this is only option, there is no index to
> use. Try explain select * from emp where empno=1 and 1=2, index search will
> return, but it make no difference in performance since no i/o is actually
> performed.
>
> Anurag Minocha wrote:
>
> > Hi,
> > I am working on a java application and i have to caplture the table
> > structure if the tables in my database by using select * from
> > <tablename> where 1=2. But this is a fulltable scan.Is there any other
> > method by which i can capture the table structures without doing a full
> > table scan.I tried select * from <table_name> where rownum= -1.when i
> > tried this with set timing on .This takes more time than select ...1=2..
> > Please suggest some way.
> >
> > anurag
> >
> > reply at
> > anurag_at_synergy-infotech.com
Received on Sat Jul 10 1999 - 13:23:54 CDT

Original text of this message

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