View previous topic :: View next topic
|
Author |
Message |
prgaj1
New User
Joined: 13 Jul 2007 Posts: 18 Location: Pennsylvania
|
|
|
|
Hi there
We doing an audit trail and for each field I need to call a Stored procedure (SP2) which insert a record to the audit table. I want to do a sort of perform in my current Stored Procedure (SP1) but is not sure how..
Set field1 to abc...
Set field2 to abc...
Call SP2
Set field1 to cde...
Set field2 to cde...
Call SP2
.
Set......
I need to call SP2 multiple times and was wondering if I could create a LOOP or something that will iterate the same call... Is it possible? where do I find information on that...
Thanks in Advance |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
Back to top |
|
|
prgaj1
New User
Joined: 13 Jul 2007 Posts: 18 Location: Pennsylvania
|
|
|
|
If I could find it in a manual I would not have asked. |
|
Back to top |
|
|
sushanth bobby
Senior Member
Joined: 29 Jul 2008 Posts: 1020 Location: India
|
|
|
|
Prgaj1,
Quote: |
I need to call SP2 multiple times and was wondering if I could create a LOOP or something that will iterate the same call... Is it possible? |
Did you try ? Did you get any errors ?
Sushanth |
|
Back to top |
|
|
prgaj1
New User
Joined: 13 Jul 2007 Posts: 18 Location: Pennsylvania
|
|
|
|
Sushanth I got a work around could not find anything in the manual like I assume Dick Brenholtz could not either that is why he was so unhelpful and rude.. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
prgaj1 wrote: |
why he was so unhelpful and rude. |
is just another way of crying like a little baby, because I did not give you code to accomplish your task.
Since you did not bother to explain
from which programming language you were invoking the SP,
how do you expect anyone to provide you code
or actually do your work for you.
besides, it is sort of a non-question.
what do you mean invoke multiple times.
you want to loop the following:
populate parms
call
the population of the parms is the key to the loop.
you explained nothing about the source of the data/values for the parms.
your problem lies more in the area not being able to explain your requirement,
and less about a members 'social graces'. |
|
Back to top |
|
|
prgaj1
New User
Joined: 13 Jul 2007 Posts: 18 Location: Pennsylvania
|
|
|
|
If you were helpful you would have ask if you did not understand what was asked... |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
if instead of fussing You had posted some meaningful info
You would have got better replies
read and meditate on
How To Ask Questions The Smart Way
catb.org/~esr/faqs/smart-questions.html
to make the most out of the questions You ask |
|
Back to top |
|
|
prgaj1
New User
Joined: 13 Jul 2007 Posts: 18 Location: Pennsylvania
|
|
|
|
Thanks Enrico I will bookmark and next time refer to it to make sure I ask the question correct. I still feel it was not necessary for the Eric to be rude about it... Surely one do not ask a question before checking in manuals and with collegues... next time I will follow your advise on how to ask... |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
Quote: |
Surely one do not ask a question before checking in manuals and with collegues... |
if You look carefully at the forums the vast majority of the questions asked
would not have been asked if the TS had looked at the manuals
so statistics and forum experience hint that the first suggestion to give is RTFM |
|
Back to top |
|
|
mallik4u
New User
Joined: 17 Sep 2008 Posts: 75 Location: bangalore
|
|
|
|
Hi Prga1,
I am assuming that you have coded your stored procedures using DB2-SQL.
SQL has WHILE keyword for doing looping in DB2.
WHILE <condition> DO
<your SQL statements...>
END-WHILE |
|
Back to top |
|
|
prgaj1
New User
Joined: 13 Jul 2007 Posts: 18 Location: Pennsylvania
|
|
|
|
Thank you I see where you come from. I do not post a lot as most of the time I find what I need in previous posts, so that should indicate to me that the vast majority just ask before check for themselves. I have learned a lot about syncsort by just reading previous post without any before hand knowledge, so your statement is true. |
|
Back to top |
|
|
prgaj1
New User
Joined: 13 Jul 2007 Posts: 18 Location: Pennsylvania
|
|
|
|
Hi Mallik; that you very much I it was exactly what I used. We converting some COBOL programs to SQL SP's and I just did not know how on earth to do the perform. The SQL WHILE statement is actually convertion for a COBOL PERFORM UNTIL statement but I got it work for the normally COBOL PERFORM statement with a bit of IF logic inside the DO WHILE loop... I tried the "LOOP" statement but not sure I quite understand it because I needed to perform my routine for different senarios at different times, it was quite fun testing it but it work and is implemented already. |
|
Back to top |
|
|
|