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

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Pl/SQL Question

Re: Pl/SQL Question

From: David Sharples <davidsharples_at_gmail.com>
Date: Tue, 23 Aug 2005 12:08:46 +0100
Message-ID: <be592d550508230408138af89b@mail.gmail.com>


a function would be better here

create or replace function ds_func (seq_name in varchar2) return number as
seq_result number(38);
begin
execute immediate 'select '||seq_name||'.nextval from dual' into seq_result; return seq_result;
end;
/

Function created.

SQL> select test_func('dave_seq') from dual;

TEST_FUNC('DAVE_SEQ')


                   15

why you would want to do this is probably a better question

On 8/23/05, savitha malve <savithamalve_at_yahoo.com> wrote:

> I have been given a task to write a piece of pl/sql code/procedure which
> should accept a sequence name as IN parameter and output the nextval using
> OUT parameter. Any tips, ideas, suggestions will be very much apprectaited.

--
http://www.freelists.org/webpage/oracle-l
Received on Tue Aug 23 2005 - 06:10:44 CDT

Original text of this message

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