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: Help: A difficult request

Re: Help: A difficult request

From: Daniel Morgan <dmorgan_at_exesolutions.com>
Date: Thu, 16 May 2002 22:03:03 GMT
Message-ID: <3CE42C92.AD07A6CD@exesolutions.com>


Joe Bayer wrote:

> My boss asks me to let user select from a table for only one row each
> time, which is very difficult to achieve
>
> for example
>
> SQL> select * from test;
>
> SCHEMA_NAME SCHEMA_VALUE
> -------------------- --------------------
> A a
> B b
> C c
> D d
> E e
> F f
>
> 6 rows selected.
>
> Each time, we just want user to see one row,
> so I created a view
>
> 1 CREATE OR REPLACE VIEW test_view AS
> 3 SELECT *
> 4 FROM test
> 5* WHERE rownum < 2
> SQL> /
>
> View created.
>
> but I can only select the first row of the table
>
> 1 select * from test_view
> 2* where schema_name='A'
> SQL> /
>
> SCHEMA_NAME SCHEMA_VALUE
> -------------------- --------------------
> A a
>
> 1 select * from test_view
> 2* where schema_name='B'
> SQL> /
>
> no rows selected
>
> can somebody help?
>
> thanks
>
>
>
> --
> Sent by joebayerii from hotmail subpart from com
> This is a spam protected message. Please answer with reference header.
> Posted via http://www.usenet-replayer.com/cgi/content/new

There is no way to do what your boss asked. Which once again points out the danger of having people attempt to manage technology who don't understand what they are managing.

The only way to achieve this result is either to have them query a stored procedure (assuming an application interface) or to have them write their SQL with the following line at the end:

AND rownum < 1;

And if it is voluntary ... I can assure you it won't happen.

But I am fascinated by his request ... Why? Does he think it costs less????

Daniel Morgan Received on Thu May 16 2002 - 17:03:03 CDT

Original text of this message

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