|
-----Message d'origine-----
De : midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] De la part de Birgitta Hauser
Envoyé : lundi 8 novembre 2010 09:50
À : 'Midrange Systems Technical Discussion'
Objet : AW: DB2 Stored Procedures
Stored Procedures cannot handle optional parameters (in the
same way as RPG does).
But Stored Procedures can be overloaded, that means within
the same library/schema several stored procedures with the
same name, but a different number of parameters can coexist.
When calling a stored procedure the number or parameters will
be checked and the procedure with the appropriate number of
parameters will be called.
Mit freundlichen Grüßen / Best regards
Birgitta Hauser
"Shoot for the moon, even if you miss, you'll land among the
stars." (Les
Brown)
"If you think education is expensive, try ignorance." (Derek
Bok) "What is worse than training your staff and losing them?
Not training them and keeping them!"
-----Ursprüngliche Nachricht-----
Von: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] Im Auftrag von David FOXWELL
Gesendet: Monday, 08. November 2010 09:30
An: Midrange Systems Technical Discussion
Betreff: RE: DB2 Stored Procedures
Birgitta, Vern,
That was interesting, but I don't get the registration bit.
What do you mean by overloading and more secure?
And back to the OP, so there is no trade off?
-----Message d'origine-----Birgitta Hauser
De : midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] De la part de
Envoyé : dimanche 7 novembre 2010 09:21 À : 'Midrange Systemscalled without
Technical Discussion'
Objet : AW: DB2 Stored Procedures
Hi Vern,
even without using the CREATE PROCEDURE statement to register it.In fact - and I just verified this - you can call any existing
program,
That's why I wrote "must or at least should be registered".
Because of overloading it is more secure to register existing
programs.
Concerning QCMDEXC there was an enhancement within release
V5R4 or 6.1 so you can call it as follows.
Call QCMDEXC('WRKSYSSTS', 9);
... and even before this enhancement it also could be
hex notation, but the numeric value must have all 15 digitsincluding
the decimal point.the stars."
Call QCMDEXC('WRKSYSTST', 0000000009.00000);
Mit freundlichen Grüßen / Best regards
Birgitta Hauser
"Shoot for the moon, even if you miss, you'll land among
(LesSQL scripts,
Brown)
"If you think education is expensive, try ignorance." (Derek
Bok) "What is worse than training your staff and losing them?
Not training them and keeping them!"
-----Ursprüngliche Nachricht-----
Von: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] Im Auftrag von Vern Hamberg
Gesendet: Saturday, 06. November 2010 14:31
An: Midrange Systems Technical Discussion
Betreff: Re: AW: DB2 Stored Procedures
Hi Birgitta
I'm glad you generalized the topic - I was not sure whether the
original post referred only to SQL stored procedures, or the entire
range of the kinds of SPs.
To respond to the OP, stored procedures are nothing like
which I take as the source members used by RUNSQLSTM. At least notyes, there
functionally. If the stored procedure is an SQL SP, then,
will be many SQL statements.as Birgitta
But there are also external SPs - those created using HLL,
stated.doesn't return
So you can have a program you've already written that
any values, and you can use it as a stored procedure.to register
In fact - and I just verified this - you can call any existing
program, even without using the CREATE PROCEDURE statement
it. I have a program, TEST in library VERN - in STRSQL I simplyto specify
entered CALL VERN/TEST and, ba-da-bing, it ran and got an error
because it couldn't find a command that is in the program.
I have actually called QCMDEXC in an SQL session - you have
the length using hex notation, but this works -curiosity. It
call qcmdexc ('wrksyssts',x'000000000900000F')
There's probably no good reason to do this, other than
merely demonstrates possibilities - and why you should use packedFor to use
fields!!! ;-)
BTW, QCMDEXC is not listed in SYSPROCS.
Vern
On 11/6/2010 4:11 AM, Birgitta Hauser wrote:
Stored Procedures are nothing else than programs written ineither an
HLL (such as RPG, COBOL or even CL) or with pure SQL, that can be
called from any interface that supports (embedded) SQL.
an HLL asprograms (or Procedures without return value) written in
plus severalstored procedures, those programs must or at least should belanguages such as
registered with the SQL Command CREATE PROCEDURE.
In this way RPG programs can be easily called from
JAVAor
PHP.allows you
Stored Procedures written with pure SQL will be converted into
C-Programs with embedded SQL. (iSeries Navigator debugger
to either debug the SQL or C code).
SQL supports everything you can use with embedded SQL
from what Icontrol statements, such as WHILE, LOOP or REPEAT to loopthrough the
data or IFand
CASE for conditions etc.)will reduce
Using stored procedures within client server application
the traffic between client and server, because in an storedprocedure
several actions/steps are bundled.the stars."
That means a single call versus a several actions.
Mit freundlichen Grüßen / Best regards
Birgitta Hauser
"Shoot for the moon, even if you miss, you'll land among
(LesNot training
Brown)
"If you think education is expensive, try ignorance." (Derek Bok)
"What is worse than training your staff and losing them?
them and keeping them!"
-----Ursprüngliche Nachricht-----
Von: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] Im Auftrag von Dan Rasch
Gesendet: Saturday, 06. November 2010 03:53
An: midrange-l@xxxxxxxxxxxx
Betreff: DB2 Stored Procedures
I am researching the used of DB2 Stored Procedures, and
please takehave seen, the look very similar to SQL scripts.--
What are the advantages / trade-offs?
How do they compare to internal SQL, or even API's for
retrieving/modifying records?
Thanks,
- Dan
This is the Midrange Systems Technical Discussion
(MIDRANGE-L) mailing list To post a message email:
MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list
options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting,
a moment to review the archives atplease take
http://archive.midrange.com/midrange-l.
--
This is the Midrange Systems Technical Discussion
(MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting,
a moment to review the archives at--
http://archive.midrange.com/midrange-l.
This is the Midrange Systems Technical Discussion
(MIDRANGE-L) mailing list To post a message email:
MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change
list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting,
please take a moment to review the archives at
http://archive.midrange.com/midrange-l.
--
This is the Midrange Systems Technical Discussion
(MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.