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: Kennedy, Jim <jim_kennedy_at_mentor.com>
Date: Tue, 23 Aug 2005 08:52:16 -0700
Message-ID: <EF25DB6D87DD1A469C80A312C63C3B4C044443F5@SVR-ORW-EXC-07.mgc.mentorg.com>


Yes, but that wouldn't follow the paradigm: "All programing problems can be solved with an additional level of indirection."

I think they are in trouble if they persist in this type of thing. It can lead down the slipper slope of everything is dynamic and no bind variables type of thinking. If it is an isolated thing, maybe fine, but I suspect you are seeing the start of a scalability problem.

Jim

-----Original Message-----
From: oracle-l-bounce_at_freelists.org
[mailto:oracle-l-bounce_at_freelists.org] On Behalf Of Ram K Sent: Tuesday, August 23, 2005 7:56 AM
To: davidsharples_at_gmail.com
Cc: savithamalve_at_yahoo.com; oracle-l_at_freelists.org Subject: Re: Pl/SQL Question

Hi,    

   Cant we select directly from a sequence without having to use a function? Is there any advantage to using a function?    

Thanks

On 8/23/05, David Sharples <davidsharples_at_gmail.com> wrote:
> 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
>

--
Thanks,
Ram.
--
http://www.freelists.org/webpage/oracle-l
--
http://www.freelists.org/webpage/oracle-l
Received on Tue Aug 23 2005 - 10:54:18 CDT

Original text of this message

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