Re: Simple PL/SQL question about sequences

From: N Prabhakar <prabhs_at_po.pacific.net.sg>
Date: 1996/11/16
Message-ID: <56j5oj$d0m_at_newton.pacific.net.sg>#1/1


Jim Mc Ree <mcree_at_orionsci.com> wrote:
>I want to implement a PL/SQL function where I pass in the name of a
>sequence and get back the next value in the sequence. I am brand-new to
>Oracle and PL/SQL and haven't found a way to do this (that compiles) on
>my own, so I thought the net would have the answer. It seems like such
>a simple problem. Here's what I currently have:
>

Hi there,

Since you are passing the name of the sequence as a parameter to your function, you need to use dynamic sql to retrieve the last number for that sequence.

It can be implemented by using DBMS_SQL package by which you can substitute the input sequence name and retrieve the current value

I am not sure about the syntax. My sincere apologies.

Regards

N.Prabhakar Received on Sat Nov 16 1996 - 00:00:00 CET

Original text of this message