You absolutely can declare and process cursors in stored procedures in both
DB2 for zOS (V7) and DB2 for LUW.
The only diff I'm aware of between zOS and LUW w.r.t cursors is related to
returning resultsets.
I think (!) zOS has only RETURN TO CALLER resultsets. DB2 for LUW also has
RETURN TO CLIENT.
With scripts do you mean "anonymous blocks"?
DB2 for zOS has no support for anonymous blocks. DB2 for LUW has some
("compound statement (dynamic)").
No one prevents you from storing your scripts (SQL, PERL, DOS....) or
application source code in the database though.
I confess I'm failing to see the benefit of having a formalized process for
that....
Cheers
Serge
"Edwards Ed " <db2udbdba-ezmlmshield-x69248716.[Email address protected]
wrote on 08/26/2005 08:56:42 AM:
> Serge,
> In Oracle, you create procedure and store it in the database.
> But, in this stored procedure, you can have a cursor. I know you
> can store a procedure in the DB2 database (I think, starting with
> version 8.1 for Windows) but can it have a cursor in it? You can't
> do this in OS/390.
>
> Also, can you store scripts (SQL) in the database? If so, what
version?
>
>
> -----Original Message-----
> From: Serge Rielau
> [mailto:db2udbdba-ezmlmshield-x21956168.[Email address protected]
> Sent: Friday, August 26, 2005 8:21 AM
> To: LazyDBA Discussion
> Subject: Re: Cursors in DB2
>
>
> Can you clarify what you mean by that?
> If you want to store a canned query that would commonly be a view.
> If the query takes arguments you can use an SQL Table Functions (I'm not
> 100% certain whether DB2 for zOS has these yet though).
>
> Cheers
> Serge
>
> "Edwards Ed " <db2udbdba-ezmlmshield-x5016511.[Email address protected]
> wrote on 08/26/2005 06:09:03 AM:
>
> >
> > Can cursors be stored in a DB2 database? If so, what version and
> > operating system? I am a DB2 DBA on the OS/390, but I have
> > downloaded and played with DB2, Version 8.1 on Windows NT (4.0,
> > service pack 6a).
> >
> > ---------------------------------------------------------------------
> > PLEASE CLICK REPLY-ALL TO SEND A REPLY TO EVERYONE
> > website: http://www.LazyDBA.com
> > To unsubscribe: http://www.lazydba.com/unsubscribe.html
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > PLEASE CLICK REPLY-ALL TO SEND A REPLY TO EVERYONE
> > website: http://www.LazyDBA.com
> > To unsubscribe: http://www.lazydba.com/unsubscribe.html
> >
>
>
>
> ---------------------------------------------------------------------
> PLEASE CLICK REPLY-ALL TO SEND A REPLY TO EVERYONE
> website: http://www.LazyDBA.com
> To unsubscribe: http://www.lazydba.com/unsubscribe.html
>
>
>
>
> ---------------------------------------------------------------------
> PLEASE CLICK REPLY-ALL TO SEND A REPLY TO EVERYONE
> website: http://www.LazyDBA.com
> To unsubscribe: http://www.lazydba.com/unsubscribe.html
>
DB2 & UDB email list listserv db2-l LazyDBA home page