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

Home -> Community -> Usenet -> c.d.o.tools -> Re: how to update a sequence?

Re: how to update a sequence?

From: Christopher Latta <nobody_at_nowhere.not>
Date: Wed, 27 Jun 2001 01:59:53 +1000
Message-ID: <fq2_6.12221$qJ4.497709@ozemail.com.au>

There's probably another (better) way, but you can do it like this (DIARY_NDIARY is the sequence for the DIARY table):

CREATE OR REPLACE
PROCEDURE UPDATE_DIARY_SEQUENCE IS
  iCtr INTEGER;
  MaxDiaryId INTEGER;
  iDummy INTEGER;
  CURSOR INIT_DIARY IS
    SELECT DIARY_NDIARY.NEXTVAL FROM DUAL; BEGIN

BEGIN
  UPDATE_DIARY_SEQUENCE;
END;
/

DROP PROCEDURE UPDATE_DIARY_SEQUENCE; HTH
Christopher Latta
Norbert Lemke <ofenroor_at_gmx.de> wrote in message news:9ha682$cgdcd$1_at_ID-76747.news.dfncis.de...
> Hi,
>
> I have an oracle sequence, it generates unique keys (everything all right
 so
> far). With my Visual-Basic-GUI I can create single records 'insert into
 tab
> (id) values(seq.nextval)', and everything works fine.
>
> But now I want to insert some bulk data, 10,000 records at once. I want to
> do this wiht the SAS-software, which has an own data format and own method
> for appending records.
Received on Tue Jun 26 2001 - 10:59:53 CDT

Original text of this message

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