Re: creating stored procedure

From: Frank <franjoe_at_frisurf.no>
Date: Sat, 10 Feb 2001 14:34:54 +0100
Message-ID: <iwbh6.2640$xT3.73490_at_news1.oke.nextra.no>


Hi!

[Quoted] We have also choosen to prefer stored procedures instead of scripts.

The reason is you get fewer development environments (only Oracle database not UNIX). This means that you
[Quoted] [Quoted] simply have fewer things to keep in order. Keep the Database running an the code is there (and working ?-).
[Quoted] [Quoted] It is also easier to copy the database to test/development environment, [Quoted] because everything is copied in the same [Quoted] [Quoted] way and everything is in the Database. With SQLPlus you sometimes must create temporary files/scripts
to achieve things - another thing to remember when moving/copying a database.

Business logic have a tendency to grow in complexity, PLSQL is easier to allow business logic to "grow" in
[Quoted] [Quoted] (become more complex). SQLPlus scripts are easy when the problem is easy, [Quoted] but very hard when the problem grows.

[Quoted] [Quoted] Actually we would not have choosen the cron solution either, we would have used the DBMS_JOB. I believe the
[Quoted] [Quoted] application becomes easier to document/hand over to other people, when [Quoted] everyting(?) is in the Database.

Frank

<vikasmamta_at_my-deja.com> wrote in message news:95sfc6$72g$1_at_nnrp1.deja.com...
> Hi Alex
>
> Thanks for the help.
> Writing SQL script is more easier. My boss wants me to write a stored
> procedure. I want to know would the stored procedure run from cron or
> not. Can I tell him it is better to run SQL script than stored
> procedure.
>
> Thanks in anticipation.
> In article <95s7hu$v5d$1_at_nnrp1.deja.com>,
> Alex Filonov <afilonov_at_pro-ns.net> wrote:
> > I don't think you really need a stored procedure. May be sqlplus
 script
> > will work for you. In that script you can easily use truncate. It's
> > also easier to run sqlplus script from cron.
> > One more suggestion. Even if you decide to use stored procedure, use
> > insert into <temp table>
> > as select ....
> > statements. It'll save you time.
> >
> > In article <95p2l8$4ik$1_at_nnrp1.deja.com>,
> > kushan <vikasmamta_at_my-deja.com> wrote:
> > > Hi
> > >
> > > I am creating a stored procedure to select the data from 5 tables &
> > > then inserting into one table. And I want to run this procedure
 hourly
> > > by setting its cronjob. Can you check my syntax
> > >
> > > Create or replace procedure P1
> > > Begin
> > >
> > > Select ......... from ..... where...=....;
> > > Insert into temp table ........;
> > > Select ......... from ..... where...=....;
> > > Insert into temp table ........;
> > > ....like this many selects & inserts......
> > > end;
> > >
> > > Is that necessary to give parameters in or out or would it work.
> > >
> > > one more thing Everytime when the procedure will run it will get the
> > > completedata from different table & insert it into temp table so
 that
> > > temp table keep on getting duplicated rows. If I create a primary
 key
> > > in the temp table would that help me. Or do I need to use truncate.
 If
> > > So where i need to write this truncate in the procedure. Please help
 me
> > > out with this problem> I am in real trouble.
> > >
> > > Thanks
> > >
> > > --
> > > RICHARD
> > >
> > > Sent via Deja.com
> > > http://www.deja.com/
> > >
> >
> > Sent via Deja.com
> > http://www.deja.com/
> >
>
> --
> RICHARD
>
>
> Sent via Deja.com
> http://www.deja.com/
Received on Sat Feb 10 2001 - 14:34:54 CET

Original text of this message