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: Help with Sequences in Embedded SQL

Re: Help with Sequences in Embedded SQL

From: Jim Lyons <j.lyons_at_cc.utexas.edu>
Date: Mon, 02 Nov 1998 11:49:10 -0600
Message-ID: <363DF096.1@cc.utexas.edu>


Teresa Mah wrote:

> I've already created a table and a sequence for the primary key of the
> table in SQL*Plus. Now, I want to write an Embedded SQL function which
> inserts tuples into the table, uses the sequence for the primary key
> values. However, when I compile my Embedded SQL code and try to run it,
> nothing gets inserted into the table because the compiler does not
> recognize the sequence name. Does anyone know how to fix this?

In the values list for the insert you would use an expression like myseq.nextval to get the next value in the sequence.

Remember, sequences are objects and therefore have owners. Be sure that if the owner of the sequence is not the owner running the program that you specify the owner and have proper privileges.

--

Jim Lyons                     |  Operating Systems Specialist
ACITS                         |  512-475-9331
University of Texas at Austin | j.lyons_at_cc.utexas.edu http://uts.cc.utexas.edu/~jlyons Received on Mon Nov 02 1998 - 11:49:10 CST

Original text of this message

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