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: Query to return PK sequence gap ??

Re: Query to return PK sequence gap ??

From: <fitzjarrell_at_cox.net>
Date: Tue, 09 Oct 2007 05:42:39 -0700
Message-ID: <1191933759.139638.314760@k79g2000hse.googlegroups.com>


Comments embedded.
On Oct 9, 4:33 am, krisl..._at_gmail.com wrote:
> Hi All,
>
> I want to make a query that return PK sequence gap.

Why?

> How to do that ?
>

Any number of ways; two have already been given you.

> here is my DDL :
> Create Table EMP_TEST(
> emp_id number primary key,
> emp_name varchar2(30)
> );
>
> insert into EMP_TEST values (1, 'john');
> insert into EMP_TEST values (3, 'didier');
> insert into EMP_TEST values (5, 'cole');
>
> The query will have two bind variables :
> :emp_id_from and :emp_id_to
>
> If I pass 1 to :emp_id_from and 7 to :emp_id_to , the query should
> return :
>
> PK _GAP
> --------------
> 2
> 4
> 6
> 7
>
> Thank you for your help,
> xtanto

Again, why do you 'need' to find this 'information'? What purpose does it serve?

David Fitzjarrell Received on Tue Oct 09 2007 - 07:42:39 CDT

Original text of this message

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