LOOP PROCESSING
Hi,
I have one query regarding loop.
suppose i have fields like f1,f2,f3,..f5.
now all the data's are stored in wa.
is it possible to make the loop like
loop at wa-f1 to wa-f5.
processing.
endloop.
Is it process for wa-f1, wa-f2, wa-f3, wa-f4, wa-f5.
If it is not possible then pls suggest me.
Salil,
If I understand you right, your fields are different fields with different names within the same structure like this:
data: begin of wa,
f1 type p,
f2 type p,
f3 type p,
f12 type p,
end of wa.
If this is so, then LOOP is not a way to attack your problem. Instead have a look at this construct:
DO 12 TIMES VARYING f FROM wa-f1 NEXT wa-f2.
processing. Here just sum up the values
tot_f = tot_f + f.
ENDDO.
You have to make sure all fn fields are of same type and are separated from each other with the same distance.
Similar Messages
-
Hi,
Can anyone tell me how do i check the looping processes in unix and how can i resolve it.I am not sure what you trying to ask, but my general understanding of you question tells, that you are trying to find out a session with lots of CPU utilitzation(looping)
on your command prompt type:
oracle(FC4/) % prstat
or
oracle(FC4/) % top
PID USERNAME SIZE RSS STATE PRI NICE TIME CPU PROCESS/NLWP
25291 oracle 3288M 3251M sleep 21 0 0:00.26 2.2% oracle/2
by looking at under the "PID" column and co-relating the value with "CPU" column value will tell you which session/process are consuming lots of CPU, as you have mentioned already that there are some looping processes.
hope it helps.
Cheers,
Z
Message was edited by:
Zahid Lakhani -
How to design a loop process in BPEL
Dear all:
Thanks in advance for your any suggestion.
Scenario
I try to implement a BPEL which runs some activities periodically until meets some condition.
Problem
1. How should I goto the start activity of the loop when the process finishes one cycle?
2. Could BPEL terminate in the middle of the cycle rather than in the end of the cycle?
Pls apologize the unclear description, waiting for your words.
BR,
RobertI dont understand the exact requirement, but you may try
1)desing bpel process A and bpel process B. have your repeatative tasks as a part of process B. Keep Wait Activity in process A to halt process execution. After the wait will be over, the process B will again gets executed. You may like to use While loop withing process A instead of creating process B.
2) You can think about scheduling BPEL process. the server will make sure to execute the BPEL process at specific time intervals. -
Problem loop processing with a foreground task
Another problem: I have taken the example task provided by SAP to create a sales order in the foregrouund by passing it data from an ORDERS IDoc (the task is TS20000615). This task calls transaction VA01 with the data from the IDoc converted into a BDC table, and then displays what is happening as a foreground process.
I wanted to have this in a LOOP until a sales order nuumber was created; my thinking was if somebody starts the task and is unable to save the order at that time, the existance of the order number would be the LOOP condition, and a new work item would appear in the recipients inbox.
When I tried this, I end up in a constant screen processing loop, never seeming to exit the task, i.e. it looks as if when I cancel the processing for one task, it automatically starts the next and displays the screen processing.
Is there an obvious mistake here, or am I doing something that is fundamentally flawed?Anthony,
What you need is task based on an asynchronous method with a terminating event. This will keep the same WI active until it is succesfully completed instead of generating a new WI for each execution.
Change the property of your BDC method to Asynchronous.
Define a terminating event for your task (inputFinished?).
Cheers,
Ramki. -
Simulataneous While Loop Processing
Hi,
I have an application that is based on an Event Structure. When a start button is pressed an even is triggered (START Button) that contains a while loop. The while loop runs a test for a specified time. Whilst this loop is running all other functionality within the application is disabled. I need to be able to click on other tabs and trigger other events whilst this loop within the event structure is running.
I think I need to be running parallel loops or something but I dont see how I can do that and still have the event triggering functionality.
I have attached my working vi in hope that it highlights what I mean. Any advice would be gratefully received :-)
Liz
Attachments:
IDTS Working Extract Data.vi 333 KBYou have about 90% too much code!
Does it really take 2 "delete from array" followed by "index array" to simulate an "array subset"???
In the "load" event, you have two consecutive loops, the first creating an array of indices that you then autoindex out in the next loop and throw away later. I guess one loop would be enough, simply wiring to [i].
You are not using any terminals, but only value property nodes.
You are constanty growing and shrinking arrays in shift registers.
It is a very bad idea in general to trap code in a while loop inside an event structure.
First of all, don't use "lock front panel until event completes", but the overall problem is much deeper. You could probably use the outer loop and the timeout event for the "start" part. See e.g. http://forums.ni.com/ni/board/message?board.id=170&view=by_date_ascending&message.id=224817#M224817
LabVIEW Champion . Do more with less code and in less time . -
I can turn the iPhone off by holding down the power button and releasing when i see the blue screen. I have tried to restore the iPhone in iTunes by putting it into recovery mode, but after about 10-20 minutes of it restoring the iPhone suddenly looses connection with the computer and goes back into the loop process. What should i do?
Hello Simmo1997,
Sorry to hear about your issue but let’s see if we can get your iPhone back up in running. If your iPhone is disconnecting when trying to restore then check out the article below to get you started with isolating the issue. Let me know if it gets resolved or if you discover a new symptom.
iTunes: Resolve USB-related alerts
http://support.apple.com/kb/HT5772
Regards,
-Norm G. -
Can a EDQ Process perform looping ?
Hello,
I want to create a looping process in EDQ. Here is the scenario..
Reader based on a snapshot/data store.
1. Process reads one record at a time from Reader.
2. For each record,
a. Call an external web-service (inserts the record in CRMOD, and returns Row-Id)**,
b. Writes the record + CRMOD.Row_ID to a Writer (CSV file),
c. Return to Reader and pick up the next record,
Until No more records.
**I have already created the custom script processor for the CRMOD web-service and it works.
Is this type of flow even possible in EDQ ?
Thanks in advance.
Deepak Gopal.
eVerge, LLC.Hi Nick,
Thanks for your response. Yes I have written a process. The process has two processors. I have attached the dxi.
1. Reader - Reads 100 records from snapshot (based on csv file)
2. Script Processor - takes input (four fields), calls CRMOD query web service and performs query on the four fields, returns CRMOD data.
The problem is, EDQ is flooding CRMOD and maxing out the concurrent session limit - 100 records get to CRMOD so quickly that they end up being too many concurrent sessions in CRMOD, which has limit of 5 concurrent sessions for this particular account.
So my thought was - Don't process next record in EDQ until the current transaction has completed (so we maintain only one concurrent session in CRMOD).
Here is my script..
addLibrary("http");
function GetValue(content, name) {
var value = "";
var startPos = content.indexOf("<" + name + ">");
if (startPos > -1) {
var endPos = content.indexOf("</" + name + ">", startPos);
value = content.substring(startPos + name.length + 2, endPos);
return value;
try {
var result = new Array();
var inputFN = input1[0];
var inputMN = input1[1];
var inputLN = input1[2];
var inputEmail = input1[3];
var inputTitle = input1[4];
var url = "https://secure-slsomxuda.crmondemand.com/Services/Integration";
var xmlHttp = new XMLHttpRequest();
xmlHttp.open("POST", url, false); ---------------------- false = synchronous session ------------------------------
var request = "<?xml version='1.0' encoding='UTF-8' ?>" +
" <soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/' xmlns:con='urn:crmondemand/ws/contact/' xmlns:con1='urn:/crmondemand/xml/contact'>" +
" <soapenv:Header>" +
" <wsse:Security xmlns:wsse='http://schemas.xmlsoap.org/ws/2002/04/secext'>" +
" <wsse:UsernameToken>" +
" <wsse:Username>xxx</wsse:Username>" +
" <wsse:Password Type='wsse:PasswordText'>xxx</wsse:Password>" +
" </wsse:UsernameToken>" +
" </wsse:Security>" +
" </soapenv:Header>" +
" <soapenv:Body>" +
"<con:ContactWS_ContactQueryPage_Input>" +
"<con1:ListOfContact>" +
"<con1:Contact>" +
"<con1:ContactId></con1:ContactId>" +
"<con1:ContactEmail>='" + inputEmail + "'</con1:ContactEmail>" +
"<con1:ContactFirstName>='" + inputFN + "'</con1:ContactFirstName>" +
"<con1:JobTitle>='" + inputTitle + "'</con1:JobTitle>" +
"<con1:ContactLastName>= '" + inputLN + "'</con1:ContactLastName>" +
"<con1:MiddleName>='" + inputMN + "'</con1:MiddleName>" +
"</con1:Contact>" +
"</con1:ListOfContact>" +
"</con:ContactWS_ContactQueryPage_Input>" +
"</soapenv:Body>" +
"</soapenv:Envelope>";
xmlHttp.setRequestHeader("SOAPAction", "\"document/urn:crmondemand/ws/contact/:ContactQueryPage\"");
xmlHttp.send(request);
var response = "" + xmlHttp.responseXML;
var result = new String();
var startPos = response.indexOf("<Contact>");
while (startPos > -1)
var endPos = response.indexOf("</Contact>", startPos);
var record = response.substring(startPos, endPos);
var conid = GetValue(record, "ContactId");
result = conid;
startPos = response.indexOf("<Contact>", endPos);
if (startPos = response.indexOf("SBL-ODU-01003") > -1)
{ result = "Session Limit Reached";}
catch (e) {
result = "Error: " + e.toString();
output1 = result;
Thanks,
Deepak. -
Why use cursor and for loop?
Hi All
So in general why would we use a cursor and a for loop to do update in a stored procedure?
Why wouldnt we just use a single update statement ?
is there compelling reason for using a cursor and a for loop: I am reading some code from a co-worker that the business logic for the select (set need to be updated) is complex but the update logic is simple (just set a flag to (0 or 1 or 2 or 3 or 4).
But eventually the select come down to a key (row_id) so I re-write it using just a single sql statement.
The size of the main table is about 2.6 to 3million rows
Any thoughts on that??
The code below I just do a google for cursor for update example in case for something to play with
-Thanks for all your input
create table f (a number, b varchar2(10));
insert into f values (5,'five');
insert into f values (6,'six');
insert into f values (7,'seven');
insert into f values (8,'eight');
insert into f values (9,'nine');
commit;
create or replace procedure wco as
cursor c_f is
select a,b from f where length(b) = 5 for update;
v_a f.a%type;
v_b f.b%type;
begin
open c_f;
loop
fetch c_f into v_a, v_b;
exit when c_f%notfound;
update f set a=v_a*v_a where current of c_f;
end loop;
close c_f;
end;
exec wco;
select * from f;
drop table f;
drop procedure wco;
Joining multiple tables
create table numbers_en (
id_num number primary key,
txt_num varchar2(10)
insert into numbers_en values (1, 'one' );
insert into numbers_en values (2, 'two' );
insert into numbers_en values (3, 'three');
insert into numbers_en values (4, 'four' );
insert into numbers_en values (5, 'five' );
insert into numbers_en values (6, 'six' );
create table lang (
id_lang char(2) primary key,
txt_lang varchar2(10)
insert into lang values ('de', 'german');
insert into lang values ('fr', 'french');
insert into lang values ('it', 'italian');
create table translations (
id_num references numbers_en,
id_lang references lang,
txt_trans varchar2(10) not null
insert into translations values (1, 'de', 'eins' );
insert into translations values (1, 'fr', 'un' );
insert into translations values (2, 'it', 'duo' );
insert into translations values (3, 'de', 'drei' );
insert into translations values (3, 'it', 'tre' );
insert into translations values (4, 'it', 'quattro');
insert into translations values (6, 'de', 'sechs' );
insert into translations values (6, 'fr', 'six' );
declare
cursor cur is
select id_num,
txt_num,
id_lang,
txt_lang,
txt_trans
from numbers_en join translations using(id_num)
left join lang using(id_lang)
for update of translations.txt_trans;
rec cur%rowtype;
begin
for rec in cur loop
dbms_output.put (
to_char (rec.id_num , '999') || ' - ' ||
rpad (rec.txt_num , 10 ) || ' - ' ||
rpad(nvl(rec.txt_trans, ' '), 10 ) || ' - ' ||
rec.id_lang || ' - ' ||
rpad (rec.txt_lang , 10 )
if mod(rec.id_num,2) = 0 then
update translations set txt_trans = upper(txt_trans)
where current of cur;
dbms_output.put_line(' updated');
else
dbms_output.new_line;
end if;
end loop;
end;
/Edited by: xwo0owx on Apr 25, 2011 11:23 AMAdding my sixpence...
PL/SQL is not that different from a SQL perspective than any other SQL client language like Java or C# or C/C++. PL/SQL simply integrates the 2 languages a heck of a lot better and far more transparent than the others. But make no mistake in that PL/SQL is also a "client" language from a SQL perspective. The (internal) calls PL/SQL make to the SQL engine, are the same (driver) calls made to the SQL engine when using Java and C and the others.
So why a cursor and loops in PL/SQL? For the same reason you have cursors and loops in all these other SQL client languages. There are the occasion that you need to pull data from the SQL engine into the local language to perform some very funky and complex processing that is not possible using the SQL language.
The danger is using client cursor loop processing as the norm - always pulling rows into the client language and crunching it there. This is not very performant. And pretty much impossible to scale. Developers in this case views the SQL language as a mere I/O interface for reading and writing rows. As they would use the standard file I/O read() and write() interface calls.
Nothing could be further from the truth. SQL is a very advance and sophisticated data processing language. And it will always be faster than having to pull rows to a client language and process them there. However, SQL is not Turing complete. It is not the procedural type language that most other languages we use, are. For that reason there are things that we cannot do in SQL. And that should be the only reason for using the client language, like PL/SQL or the others, to perform row crunching using a client cursor loop. -
Exception Processing Question -Reply
I don't use Forte (yet--that's why I joined the mailing list), but since your
question is a generic "engineering practices" question, I'll chime in. I do
use exceptions both in C++ in Delphi, and have developed some opinions
about how to use them:
- Use exceptions for handling "behavior unexpected in the normal course
of your algorithm". In other words, instead of returning error codes
when something goes wrong, throw an exception.
One example of this is in a parser: if you get an illegal token, just throw
an exception.
- When you need to make a choice based on a return status, don't throw
an exception. In the parser example, if you get token 'A', you need to do
one thing and if you get token 'B' you need to do another.
- There's a fine distinction between "handling an error" and "making a
choice", and there are cases where you could argue one way or the
other. I'd say that an error throws an exception when it would normally
terminate the normal flow of execution. For example, "out of memory" or
"illegal token".
- Catch exceptions at "high level" process start/end points, or where it is
required to clean up resources held and rethrow.
- Don't catch exceptions in every single method--it defeats the purpose.
User Interfaces:
- If your user-interface dictates a logical place to unwind no further,
catch exceptions there. For example: In the Windows world most apps
are a window with a menu. If you pull down and pick a menu item to
execute a command, and that command throws an exception, the
exception should be caught, a modal message box indicating the error
should be presented, and then when the user clicks "ok", the program
returns to its normal waiting state with the window intact.
- If you have a modal dialog up, throwing an exception should either stop
at the dialog's event loop or take the dialog down with it.
I'd say that on-screen data validation should NOT use exceptions
because "user typing invalid data" is expected behavior for a UI.
Besides, the UI designer should be smart enough to deal with giving you
a good model for data validation. OTOH, if you take the data out of the
dialog and then pass the information as parameters to a function, and
that function can't handle one of the parameter values, it should throw an
exception.
Nevertheless, if your dialog runs out of memory for some reason, it
should throw an exception and the dialog should come down.
Hope this helps.
-- Conrad Herrmann
Jerry Fatcheric <[email protected]> 07/24/96 03:29am >>>
I have a toss up question for 50 points -
We have finished the first phase of our project and have place
exception processing in the places where we saw exceptions could be
raise. But what about those other exceptional exceptions?
Is this just good programming practice to have a high level generic
exception handler (and what should it really do??) or is it critical.
In addition, when handling data validation on specific widgets on a
screen (e.g. the account number entered must be one of the existing
10,000 valid ones), should this be handled via exception processing or
should it just be handled with code in the event loop?
Any opinions - please I don't want to hear the Forte Party line.
I would like to hear opinions based upon real experience.
Jerry Fatcheric
Relational Options, Inc.
Florham Park, New Jersey
201-301-0200
201-301-00377 (FAX) [email protected]We have finished the first phase of our project and have place
exception processing in the places where we saw exceptions could
be raise. But what about those other exceptional exceptions?
Is this just good programming practice to have a high level
generic exception handler (and what should it really do??) or
is it critical.IMHO, you need to program for these ones that could occur because
if you don't the exception will still happen except without
your normal graceful (or standard) approach manner. I think it is good programming
practice to trap on the ones you think can possible occur if they require
something different in how they react. Otherwise, use of GenericException
with a proper response is called for.
>
In addition, when handling data validation on specific widgets
on a screen (e.g. the account number entered must be one of the
existing 10,000 valid ones), should this be handled via exception
processing or should it just be handled with code in the event loop?
I use event loop processing because most of the time I am also
keeping the user on the same widget after cancelling all events
posted. So, in effect they are back where they started from.
Any opinions - please I don't want to hear the Forte Party line.
I would like to hear opinions based upon real experience.
Jerry Fatcheric
[email protected]@Sagesoln.com
my 2 cents, or should I say my attempt at 50 points, Jerry.
Len Leber
ATG Partners -
Robohelp - main page loops/refreshes continously when using Firefox
All,
I have read through all of the posts and unfortuantely I have not been able to find a solution to my problem.
Problem: When accessing online help in Firefox, the main page loads for the most part but before it's complete, it reloads the main page again. This looping process is endless (main page reloading) and if I click on any links, the link will start to load and then main page starts to loads agan and again... When I access online help via IE, I do not experience the same problem. In IE, the main page loads and online help functions correctly. Ironically, another online help was created for a different product that is hosted on the same machine (linux) but when i access that help, i do not experience the looping problem.
I am using Firefox version 3.6.
Things that I have tried to fix the problem:
access online help in Firefox (safe mode)
use default theme
access online help in version 1.5 or 2.0 in firefox
change the page encoding
disable all plug-ins
I have also compared all of the javasript files from the working help and the problematic one and for the most part, everything is the same. The working help has 9 more js files but i think its because its context sensitive (not sure).
One way that I can stop the page from looping is by changing the encoding in the browser. No matter what its set to, if i change it and refresh the page, the looping stops but the Search field does not appear and after a short period of time, the pages doesnt respond.
Any ideas? Thank your for your time and consideration. If you would like to ask me some questions about this problem, my number is 703.227.4890. ThanksYou are correct Peter. The file is sent to me in a zip format. I have unzipped it and placed its contents in a folder. I accessed the .htm page that you asked me to. It works fine (locally).
To clarify -
I am experiencing the problem when i access online help from the application and by directly entering the url in firefox.
The other version that was developed for another product works correctly when i enter in the url in firefox and access the link directly. I do not have access to the application to navigatie from within it to online help but i am pretty sure that it works fine also.
the version is webhelp 5.5. sorry for the confusion.
meta name="generator" content="RoboHelp by eHelp Corporation www.ehelp.com">
<meta name="description" content="WebHelp 5.50">
Thank you for all of your help -
How do I delete a process that's running in the background?
A process called "tunmgr" is using up 99% of my cpu causing my macbook air to overheat (and the fan(?) to be really loud). I've searched about the process/file and a few websites basically just says that it is a Blackberry app(?) and that it hasn't been confirmed (yet) to be harmful.
I've already deleted the blackberry desktop manager on my computer as I've recently switched to iPhone. Is it safe for me to delete "tunmgr" and how do I do that?
Every time I notice my computer overheating, I had to keep going to Activity Monitor to force quit the process/file.I had the same problem and researched it. The tunmgr is essentially a bug that spawns a looped process due to checking the "Open Blackberry Link when a device is connected" in Blackberry Link. To stop the process, open Blackberry Link -->> Preferences (not in the main menu, the gear in the top right corner) -->> uncheck "Open Blackberry Link when a device is connected". Then restart and it should be back to normal.
ps - thanks for fixing this Blackberry! -
Move to next record in a LOOP!
I have to perform a loop on an internal table consisting of several records.
within the LOOP there is an if-endif condition followed by some code.
Now, in the else condition of the if-endif part, i have to move to the next record (i.e. next record in the internal table)...If i use "Exit",the entire loop processing is skipped, but i just want to skip the current sy-index and loop for the next record in the internal table.
Please suggest some way to do it.loop at itab.
if <condn>.
else.
continue.
endif.
endloop.
continue will process the next loop from begining i.e. after continue it will go to the loop at itab statement for next loop pass.
regards
shiba dutta -
BPEL process blue print not importable by JDeveloper
Hi
I have a troublesome BPEL process that is not being imported into JDeveloper. Others work fine and the closed loop process change management works great.
However, this particular one is annoying.
On selecting the process, JDeveloper downloads the required information. I click 'Next' and/or 'Finish' and it starts 'Creating Project'. That's all it does. Eventually it finishes and nothing has been added to the project.
Has anyone seen this before, or know where a log may be of the process to debug it?
Any help most appreciated.
I am using 10.1.3.4 BPA Suite and 10.1.3.3 JDev
Cheers
ChrisAha
I get the following exception occuring.
## download =C:\DOCUME~1\cbell\LOCALS~1\Temp\bpaserver_download20348.zip
## download =C:\DOCUME~1\cbell\LOCALS~1\Temp\bpaserver_download20349.zip
java.io.IOException
at oracle.ide.net.URLFileSystem.copy(URLFileSystem.java:297)
at oracle.tip.tools.ide.common.bpeldesigner.util.Helper.copyFiles(Helper.java:130)
at oracle.tip.tools.ide.pm.projectwizard.JDevProjectBuilder.createExistingBluePrintProject(JDevProjectBuilder.java:144)
at oracle.tip.tools.ide.pm.projectwizard.JDevProjectBuilder.createIDEProject(JDevProjectBuilder.java:71)
at oracle.tip.tools.ide.pm.projectwizard.BPELProjectWizard.handleFinish(BPELProjectWizard.java:57)
at oracle.tip.tools.ide.common.graph.wizard.JWizard$1.run(JWizard.java:400)
at java.lang.Thread.run(Thread.java:595)
Think I may raise an SR.
Cheers
Chris -
Hello All,
I'm writing a loop in Oracle forms to check a data in master-detail relationship. Can some one please help where I should start this code?
Abdiset_application_property(cursor_style, 'BUSY');
FIRST_RECORD;
LOOP
-- processing
IF :System.Last_Record = 'TRUE' THEN
EXIT;
END IF;
NEXT_RECORD;
END LOOP;
set_application_property(cursor_style, 'DEFAULT');
the only problem which I has was that you must be in the block throught which you do this processing. If you call this from button set mouse and keyboard navigation to false. Or do before this loop GO_BLOCK(). -
How to exit Loop in the middle
I have a requirement of exiting a loop in between, if a particular condition is satisfied. How do i achieve this in workflow? I thought of using 'Process Control' but it has no option to exit a loop from the middle....is there a way out?
Hi,
Loop runs until a condition is met.
So to exit a loop you need to set a condition as false at a step and then it would exit.
To do so, you can set a flag value in the loop processing. When ever the flag is initial keep on processing the loop and when you want the loop to exit, just set the value of the flag.
Hope this helps!
Regards,
Saumya
Maybe you are looking for
-
Only recently has Firefox for my macbook pro been acting strange when starting up. I will hear a piano chord play only once when the tabs are loading. Over the past two-three weeks on daily usage, this has happened three times. I'm just concerned my
-
EMC Initialization failed: WinRM HTTP error 403
We have an existing 2003R2 server running Exchange 2007. I have just installed a new 2012 R2 server with Exchange 2010 SP3 RU8v2. Opening the EMC on this new server yields the following error: Connecting to remote server XXXXX.DOMAIN.LOCAL failed wit
-
Hello, Home computer based on: - Asus P6T W Professional - Intel i7 3.2GHz extreme - VelociRaptor drives - 12 GB (2 x triple channel 1600MHz) - nVIDIA Quadro FX 4800 adapter. - Windows Vista 64bits Extreme (french version) Using Illustrator CS3 (fren
-
How to reset macbook to factory system ?
My Macbook is keep popping out those advertisement and those virus website . Watching online drama is also very lag , how can i fix these problem ? Mac Pro Os x 10.9.5
-
Restricting email to local only in and out for student users... ?
So I don't know if my Googling skills are dissipating or what, but I can't seem to find anyone out there that's trying to accomplish the same thing I am... The school I manage IT stuff for currently shares an ancient PowerMac G4 based FirstClass emai