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

Home -> Community -> Usenet -> c.d.o.misc -> Re: create sequence problem !! pls help

Re: create sequence problem !! pls help

From: Billy Verreynne <vslabs_at_onwe.co.za>
Date: Mon, 30 Dec 2002 11:16:01 +0200
Message-ID: <aup31c$5ju$1@ctb-nnrp2.saix.net>


pke wrote:

> is it possible to do this?
>
> create sequence Test
> start by x
> increment by 1
> cache 1000;

No.

>
> where x is a variable which is determined in a PL/SQL procedure
> CREATE OR REPLACE PROCEDURE findID
> ( x OUT SMALLINT) AS
> v_max Test.ID%TYPE;
> BEGIN
> SELECT max(id) INTO v_max FROM Test;
> x:=v_max;
> END;
>
> BEGIN
> findID(:x);
> END;
No.

> so x has the highest value of the ID, I want the sequence to start from
> this value!
> Or is there an other solution ... ??

What are you trying to do? The above is Bad Design (tm) irrespective of the database technology you are using.

--
Billy
Received on Mon Dec 30 2002 - 03:16:01 CST

Original text of this message

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