Loop through Array structure - using xpath
Hello,
My BPEL process logic is as follows:
a. Extract data into variable - receiveMessageInputVariable
The variable 'receiveMessageInputVariable' in turn has data in array structure. (set of items)
b. Transform the data to target structure
c. Call target partner link to store extracted data into varaible 'ServiceInputVariable'
The variable 'ServiceInputVariable' structure is similar to 'receiveMessageInputVariable'
In the BPEL process 'at process' level - I have catch-all exception handler - which must send the list of 'items' which failed during a BPEL instance.
i. If my email body has the following code as below:
<%bpws:getVariableData('receiveMessageInputVariable','XXINV_ITEM_PAY_ROW_TYPE','/ns4:XXINV_ITEM_PAY_ROW_TYPE/ITEMLINE/ITEMLINE_ITEM/ITEM_NUMBER')%>
It successfully fetches only the first item_number record of the array structure. But does not fetch the other records in the array.
ii. Similarly, I wish to print all the items (as received) to be available in the email body in the following pattern:
<%"Record One-"%>
<%bpws:getVariableData('receiveMessageInputVariable','XXINV_ITEM_PAY_ROW_TYPE','/ns4:XXINV_ITEM_PAY_ROW_TYPE/ITEMLINE/ITEMLINE_ITEM[1]/ITEM_NUMBER')%>
<%"<br/>"%>
<%"Record Two-"%>
<%bpws:getVariableData('receiveMessageInputVariable','XXINV_ITEM_PAY_ROW_TYPE','/ns4:XXINV_ITEM_PAY_ROW_TYPE/ITEMLINE/ITEMLINE_ITEM[2]/ITEM_NUMBER')%>
<%"Record Nth-"%>
<%bpws:getVariableData('receiveMessageInputVariable','XXINV_ITEM_PAY_ROW_TYPE','/ns4:XXINV_ITEM_PAY_ROW_TYPE/ITEMLINE/ITEMLINE_ITEM[N]/ITEM_NUMBER')%>
Please suggest a suitable syntax in my email body - which can loop through all itemline_item array and print all the item_numbers.
(pseudo code below)
for i in 1 .. ora:countNodes(bpws:getVariableData('receiveMessageInputVariable','XXINV_ITEM_PAY_ROW_TYPE','/ns4:XXINV_ITEM_PAY_ROW_TYPE/ITEMLINE/ITEMLINE_ITEM/ITEM_NUMBER'))
loop
<%"Item Number-"%><%bpws:getVariableData('i')%>
<%bpws:getVariableData('receiveMessageInputVariable','XXINV_ITEM_PAY_ROW_TYPE','/ns4:XXINV_ITEM_PAY_ROW_TYPE/ITEMLINE/ITEMLINE_ITEM/ITEM_NUMBER')%>
end loop;
Thanks,
Santhosh
Hi Santhosh
Try with the following approach. It may work for you
1. Create one XSD, for the HTML content
<xsd:element name="HTML">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="C1" type="xsd:string" nxsd:style="terminated" nxsd:terminatedBy="${eol}">
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
2. Create one XSL, may be you have to do this manually, as JDev will not support HTML transformations. This XSL will map your input XML to an HTML format.
3. Create one variable in BPEL of type in the above XSD
4. Use assign activity to assign the XSL transformation to the variable defined in Step#3
<from expression="ora:processXSLT('HTMLTransformation.xsl',bpws:getVariableData('Variable_Input',INPUT_TYPE'))"/>
<to variable="invokeWriteHTMLService_Input" part="HTML" query="/ns6:HTML/ns6:C1"/>
5. Copy the variable to the email body variable
<copy>
<from expression="bpws:getVariableData('invokeWriteHTMLService_Input','HTML','/ns6:HTML/ns6:C1')"/>
<to variable="varNotificationReq" part="EmailPayload"
query="/EmailPayload/ns8:Content/ns8:ContentBody"/>
</copy>
Basically, the above approach converts your input to a string value whose content is a complete HTML, and you will use only one value to assign to the email body.
Note: Please change the Variable names/XPATH Expressions/XSL file name/element names etc according to your BPEL
Hope this helps you
Regards
Ayon
Similar Messages
-
How do I Loop through a recordset using PHP
I have a recordset containing a MySql table with 5 columns, each one containing an email address of an official in a club.
Each row represents a different club, and each column a different type of official.
The first column represents chairmen, the next treasurers etc...
The recordset is called $mailset.
I need to loop through each row of $mailset and extract the email addresses of each column and concatenate them into a string seperated by semi colons ; so it ends up like this:
[email protected];[email protected];[email protected]; and so on.
This is how the recordset is set up:
mysql_select_db($database_dummyread, $dummyread);
$query_mailset = "SELECT club_chair_email, club_treas_email, club_sec_email, club_delegate_email, club_deputy_email FROM clubs";
$mailset = mysql_query($query_mailset, $dummyread) or die(mysql_error());
$row_mailset = mysql_fetch_assoc($mailset);
$totalRows_mailset = mysql_num_rows($mailset);
?>
I tried using a loop to step through the recordset, but it always shows the first record, so its not moving the pointer through the file.
The pseudo code aught to be something like this:
Initialise variables and move to the first record
If there are records to process
Read a record
Process all columns
Move on to the next record
else
if there are no records
print an error message
else
Print the results.
Can anyone give me a hint as to how to move from row to row in a recordeset under the control of a loop.
I am using PHP and MySql. (as far as I know, it is the original - not PDO or MySqli)Each call to mysql_fetch_assoc($mailset) retrieves the value at the current location and increments the pointer in the recordset array. So use either a do or while loop and call mysql_fetch_assoc($mailset) from within the loop.
From the docs:
Returns an associative array that corresponds to the fetched row and moves the internal data pointer ahead. mysql_fetch_assoc() is equivalent to calling mysql_fetch_array() with MYSQL_ASSOC for the optional second parameter. It only returns an associative array. -
If I declare an array such as the one below.
declare
type array_type is table of varchar2(100) index by binary_integer;
component_array array_type;
begin
component_array(12345) := 'One';
component_array(12347) := 'Two';
component_array(12349) := 'Three';
for i in component_array.FIRST .. component_array.LAST
loop
dbms_output.put_line(component_array(i));
end loop;
end;Is there a way to loop through only the existing binary_integer indeces? For example, if you execute the block above, you'll get an error because the loop iteration is hitting 12346 which of course doesn't exist. Other than the workaround below, is there another way using any type of array method?
declare
type array_type is table of varchar2(100) index by binary_integer;
component_array array_type;
begin
component_array(12345) := 'One';
component_array(12347) := 'Two';
component_array(12349) := 'Three';
for i in component_array.FIRST .. component_array.LAST
loop
begin
dbms_output.put_line(component_array(i));
exception
when NO_DATA_FOUND then
null;
end;
end loop;
end;
Thanks.Hi,
Not to hijack this thread, but, since this is related to my answering OP's question, I am posting here.
How come this code is erroring out?
DECLARE
TYPE array_type IS TABLE OF VARCHAR2(100) INDEX BY VARCHAR2(1000);
component_array array_type;
BEGIN
component_array(12345) := 'One';
component_array(12347) := 'Two';
component_array(12349) := 'Three';
FOR i IN component_array.first .. component_array.last LOOP
IF component_array.exists(12345) THEN
dbms_output.put_line(component_array(i));
END IF;
END LOOP;
END;errors out with no_data_found, but, this doesn't ?
DECLARE
TYPE array_type IS TABLE OF VARCHAR2(100) INDEX BY VARCHAR2(1000);
component_array array_type;
BEGIN
component_array(12345) := 'One';
component_array(12347) := 'Two';
component_array(12349) := 'Three';
FOR i IN component_array.first .. component_array.last LOOP
IF component_array.exists(12344) THEN
dbms_output.put_line(component_array(i));
END IF;
END LOOP;
END;notice the static numbers in the .exists parameter.... -
Loop through arrays sequentially
Hi!
My goal is to send update parameter commands on the serial bus att different rates depending on which "priority" a certain parameter has.
As input my idea was to use two text files, one containing a list of "high speed" = often updated parameters, and another with "low speed" = not so often updated parameters.
I start with storing the parameter numbers in two arrays, a high speed array and a low speed array.
My goal is to loop through the parameters in the high speed array and for each loop fetch one parameter name (number) from the low speed list and send that also. And so on.... continously.
The serial-com part is OK it is just the variable fetching process that is a problem. The output from this vi should be a integer value updated at a specified frequency.
Kind regards // GustafHi Gustaf,
i tried to create an example for you, please see the attachment.
Hope it helps.
Mike
Attachments:
PriorityLoop_LV80.vi 18 KB -
For loop wont loop through array built from spread sheet
im probably doing sonthing really silly but........
first i build and array out of data from a spreadsheet (RefLookup)
the spreadsheet contains 3 rows the top row is my label (to be returned later)
the second row it my maxmum value
the third row is my minimum value.
Ref in is my live feed of data to be looked up.
i then put this into a for loop, to loop through the array untill it finds which range of data the Ref in lies.....
then i simply stop the loop and output the index value.
this index value is the used to look up the spreadsheet data again and return the label for that index.
from what i can gather the code should.... work. but it doesnt seem to go passed the first itteration of the for loop
any ideas?
please and thanks
John
Solved!
Go to Solution.
Attachments:
jmRange.vi 13 KB
RefLookup.csv 1 KB
InRange.PNG 34 KBYou need to set the delimiter to comma, else you don't get all data. (read from spreadsheet file)
You are doing this way too complicated. Here's equivalent code. I am sure it can be simplified much more!
You don't need the outer while loop. finding it once is sufficient.
You probably want to add a "select" after the loop that selects NaN instead of the last value if nothing is found, based on the boolean.
Message Edited by altenbach on 03-30-2010 02:55 PM
LabVIEW Champion . Do more with less code and in less time .
Attachments:
finder.png 8 KB -
OSB: Looping through XML Structure
How could I loop through a WHOLE XML structure and check the contents of each node to determine whether it is a dateTime stamp?
I attempted a for-each loop in OSB but I could not get my expected output
A sample xml structure may look like this
<ebo:CreateQuoteEBM >
<ebo:DataArea>
<ebo:CreateQuote>
<ebo:Custom>
<chubCommon:Quote>
<chubCommon:ItemDetail>
<chub:Name>Test</chub:Name>
<chub:Value>20130527T12:02:13<chub:Value>
</chubCommon:ItemDetail>
<chubCommon:Reference>
<chubCommon:ReferenceQualifier>Bid Submit Date</chubCommon:ReferenceQualifier>
<chubCommon:Value>20130527T12:02:13</chubCommon:Value>
</chubCommon:Reference>
</chubCommon:Quote>
</ebo:Custom>
</ebo:CreateQuote>
</ebo:DataArea>
</ebo:CreateQuoteEBM>
Bonus: If it is a dateTime stamp convert into a date
Thanks!You can use FLOWR loop to loop though this, and then for each node check if conditon is (fn:data() is true and fn:matches()) to check if the node is of datetime type. fn:data() will give you the if the xml node has some data and then using fn:matches() you can compare it with the datetime pattern, You can use a regex pattern to compare 20130527T12:02:13 . For converting this date use fn:substring() get the data before "T" and use fucntion similar to this functx:mmddyyyy-to-date for converting to date.For converting to date you can also use substring to extract the data from node and then use below fucntion to convert to date.
declare function functx:date
( $year as xs:anyAtomicType ,
$month as xs:anyAtomicType ,
$day as xs:anyAtomicType ) as xs:date {
xs:date(
concat(
functx:pad-integer-to-length(xs:integer($year),4),'-',
functx:pad-integer-to-length(xs:integer($month),2),'-',
functx:pad-integer-to-length(xs:integer($day),2))) -
Hello,
I am developing a program which contains redundant code as it contains too many methods that loop through the same two dimensional array all the time.
The reason why the code is redundant is because I need to perform a different action to different values in the array each time (depending on whether statement is true or false).
What I want to try and do is create one single method which loops through the array and returns a boolean value.
The method needs to take something like an if statement as a parameter so that I can stop searching through the array when the value of some element in array satisfies the if statement.
How do I do this? How do I cut down the amount of code that searches through the same array all the time.
Hope someone can understand
ThanksAre you looking to do something like this?
interface Predicate {
boolean apply(int arg);
class IsEven implements Predicate {
public boolean apply(int arg) {
return arg % 2 == 0;
public class PredicateExample {
public boolean searchMaxtrix(int[][] m, Predicate p) {
for (int[] row : m)
for(int x : row)
if (p.apply(x))
return true;
return false;
} -
Experimenting with looping through array
I've got this piece of code to check if some input of monosyllabic or not. Hope I can explain my problem with it. What it now does, is keep track of every first and last position of a vowel in the input. For a word like "bed", it works fine. The first position of an 'e' is the same as the last one, so it says "input is monosyllabic. (I'm not writing the program for English, so for those of you wondering how to recognize the monosyllabicity of "race" for example, that's irrelevant). And of course I still need to account for words like "breed", with two consecutive vowels.
The thing is however, that the for loop keeps track of the first and last position of every vowel in the array. If a vowel from the array is not in the input, it prints "-1". Now what I want it to do, is keep track of the first and last position for 'a' vowel, and not for every vowel. So now for an input like "universe", the println(first/lastVowel) prints several lines. Being the first and last position of 'u', the first and last of 'i' and of 'e'. Because the first and last position of 'u' is equal, it also prints "input is monosyllabic".
How do I let the for loop only keep track of the first vowel and the last vowel it encounters, and not creating a specific integer value for each vowel defined in the array?
{code}char [] vowels = {'a', 'e', 'i', 'o', 'u'};
for (char item : vowels){
int firstVowel = input.indexOf(item);
int lastVowel = input.lastIndexOf(item);
System.out.println(firstVowel);
System.out.println(lastVowel);
if (!(firstVowel==-1) && !(lastVowel==-1) && firstVowel==lastVowel){
System.out.println("input is monosyllabic");
}{code}Igor_Pavlove wrote:
I've got this piece of code to check if some input of monosyllabic or not. Hope I can explain my problem with it. What it now does, is keep track of every first and last position of a vowel in the input. For a word like "bed", it works fine. The first position of an 'e' is the same as the last one, so it says "input is monosyllabic. (I'm not writing the program for English, so for those of you wondering how to recognize the monosyllabicity of "race" for example, that's irrelevant). And of course I still need to account for words like "breed", with two consecutive vowels.
The thing is however, that the for loop keeps track of the first and last position of every vowel in the array. If a vowel from the array is not in the input, it prints "-1". Now what I want it to do, is keep track of the first and last position for 'a' vowel, and not for every vowel. So now for an input like "universe", the println(first/lastVowel) prints several lines. Being the first and last position of 'u', the first and last of 'i' and of 'e'. Because the first and last position of 'u' is equal, it also prints "input is monosyllabic".
How do I let the for loop only keep track of the first vowel and the last vowel it encounters, and not creating a specific integer value for each vowel defined in the array?
{code}char [] vowels = {'a', 'e', 'i', 'o', 'u'};
for (char item : vowels){
int firstVowel = input.indexOf(item);
int lastVowel = input.lastIndexOf(item);
System.out.println(firstVowel);
System.out.println(lastVowel);
if (!(firstVowel==-1) && !(lastVowel==-1) && firstVowel==lastVowel){
System.out.println("input is monosyllabic");
}{code}You have a couple of problems with this:
1 - notice that your firstVowel and lastVowel variables are defined within the scope of your for loop so they fresh and new for each iteration of the loop. So if you never get any result other than that of 'u'. (except for the print, but you don't have any results you can actually use)
2 - for firstVowel, you just need to check if your return from your (indexOf is less than firstVowel) and (firstVowel not equal to -1): for your lastVowel you do the same but check for greater than.
To accomplish this you have to take the definition of your firstVowel and lastVowel outside of your for loop, you'll also need to use a variable to catch your indexOf so you can do the comparison for firstVowel and lastVowel. -
How to loop through a query using LINQPAD?
I have this query in LINQPAD:
SELECT TIME_TEST+TIME_STEP AS Productive_Time
FROM PFODS.PPL_TESTSYSTEMS_UTILISATION
WHERE (SYSTEMTYPE = '0005-064') AND
(TS_START >= to_date('13/01/2014', 'DD/MM/YYYY'))
AND (TS_End <= to_date('18/01/2014 00:1:59', 'DD/MM/YYYY HH24:MI:SS')) AND MONO != '9999999999'
Order by TS_START ASC
However, I need to extract out the SELECT SUM(TIME_TEST+TIME_STEP) as ProductiveTime on a daily basis, and thus I need to execute those below codes each time to extract out each day values. How do I combine those into 1 single query such that each day data
can be displayed? Do I need to write a loop inside the WHERE condition?
SELECT SUM(TIME_TEST+TIME_STEP) as ProductiveTime
FROM PFODS.PPL_TESTSYSTEMS_UTILISATION
WHERE (SYSTEMTYPE = '0005-064') AND
(TS_START >= to_date('13/01/2014', 'DD/MM/YYYY'))
AND (TS_End <= to_date('14/01/2014 00:1:59', 'DD/MM/YYYY HH24:MI:SS')) AND MONO != '9999999999'
Order by TS_START ASC
SELECT SUM(TIME_TEST+TIME_STEP) as ProductiveTime
FROM PFODS.PPL_TESTSYSTEMS_UTILISATION
WHERE (SYSTEMTYPE = '0005-064') AND
(TS_START >= to_date('14/01/2014', 'DD/MM/YYYY'))
AND (TS_End <= to_date('15/01/2014 00:1:59', 'DD/MM/YYYY HH24:MI:SS')) AND MONO != '9999999999'
Order by TS_START ASC
SELECT SUM(TIME_TEST+TIME_STEP) as ProductiveTime
FROM PFODS.PPL_TESTSYSTEMS_UTILISATION
WHERE (SYSTEMTYPE = '0005-064') AND
(TS_START >= to_date('15/01/2014', 'DD/MM/YYYY'))
AND (TS_End <= to_date('16/01/2014 00:1:59', 'DD/MM/YYYY HH24:MI:SS')) AND MONO != '9999999999'
Order by TS_START ASC
SELECT SUM(TIME_TEST+TIME_STEP) as ProductiveTime
FROM PFODS.PPL_TESTSYSTEMS_UTILISATION
WHERE (SYSTEMTYPE = '0005-064') AND
(TS_START >= to_date('16/01/2014', 'DD/MM/YYYY'))
AND (TS_End <= to_date('17/01/2014 00:1:59', 'DD/MM/YYYY HH24:MI:SS')) AND MONO != '9999999999'
Order by TS_START ASC
SELECT SUM(TIME_TEST+TIME_STEP) as ProductiveTime
FROM PFODS.PPL_TESTSYSTEMS_UTILISATION
WHERE (SYSTEMTYPE = '0005-064') AND
(TS_START >= to_date('17/01/2014', 'DD/MM/YYYY'))
AND (TS_End <= to_date('18/01/2014 00:1:59', 'DD/MM/YYYY HH24:MI:SS')) AND MONO != '9999999999'
Order by TS_START ASC
In addition to display the SUM(TIME_TEST+TIME_STEP) for each day, I also need to display the date itself.
I do no want (cannot) to write anything on Stored Procedure, and I can only write simple query.
thanks.Use a loop like the code below
DateTime startDate = DateTime.Parse("1/1/14");
DateTime endDate = DateTime.Parse("2/16/14");
int numberOfDays = (endDate - startDate).Days + 1;
for (int dateCount = 0; dateCount < numberOfDays; dateCount++)
DateTime currentDate = startDate.AddDays(dateCount);
Even better use a dictionary like in the code below
static void Main(string[] args)
DataTable table = new DataTable();
Dictionary<DateTime, List<DataRow>> dict = table.AsEnumerable()
.GroupBy(x => x.Field<DateTime>("TS_START").Date, x => x)
.ToDictionary(x => x.Key, x => x.ToList());
Console.WriteLine("Date ProductiveTime Comment");
Console.WriteLine("========== ==========");
foreach(DateTime date in dict.Keys)
List<DataRow> dateRows = dict[date];
int productiveTime = dateRows.AsEnumerable()
.Select(x => x.Field<int>("PRODUCTIVE_TIME"))
.ToList().Sum();
int firstRow = table.Rows.IndexOf(dateRows[0]);
int LastRow = table.Rows.IndexOf(dateRows[dateRows.Count - 1]);
Console.WriteLine("{0} {1} Row{2} to Row{3}",
date.ToShortDateString(), productiveTime.ToString(),
firstRow.ToString(), LastRow.ToString()); -
Need to loop through Recursive node
Hi Everyone,
I am having troubles looping through a node to get a boolean value called "Check".
Basically I am using the TreeNesteedInTable UI. One of the columns I display is the "Check" mentioned above. Basically the user can go through the tree structure and check his/her options. I should then be able to loop through this structure to get all the records "Checked". My application is not doing this.
At the moment I am looping through the top level node - think this is where my probelm is because this node can only be singleton! This means that I then have to loop through the Recusrsive node of this type to get the values as the recusrive is always non-singleton en must therefor contain the elements I am looking for. But, i do not know how tho get access to this node. Is this the correct way of doing it, or how should it be done otherwise?
Many thanks,
ChristiaanHI,
I got it to work like this:
public void addICAMForIncident( ) {
//@@begin addICAMForIncident()
IWDMessageManager msgMgr = wdComponentAPI.getMessageManager();
try {
int count;
Bapi1240_Rc rootCause;
IPublicEhs_icam.IAbsentOrFailedControlsElement existingAbsentOrFailedControlsElement;
IPublicEhs_icam.IAbsentOrFailedControlsElement recursive;
IPublicEhs_icam.IAbsentOrFailedControlsElement recursiveChildElement;
IPublicEhs_icam.IAbsentOrFailedControlsNode recursiveChildNode;
// if(wdContext.nodeAbsentOrFailedControls() != null){
// set header data:
wdContext.currentHeader_CreateElement().setRecord_No(wdContext.currentHeader_GDElement().getRecord_No());
wdContext.currentHeader_CreateElement().setRecno_Root(wdContext.currentHeader_GDElement().getRecno_Root());
wdContext.currentHeader_CreateElement().setIncident(wdContext.currentGPInputNodeElement().getIPIncidentNum());
//Top Level Node (Singleton)
existingAbsentOrFailedControlsElement = wdContext.currentAbsentOrFailedControlsElement();
//We need to go through the values of the RECURSIVE node as that is where the values are!
//Each time we expand a node in the tree this recursive node is filled with values
for(int i = 0;i<existingAbsentOrFailedControlsElement.nodeRecursiveAbsentOrFailedControl().size();i++)
recursiveChildNode = existingAbsentOrFailedControlsElement.nodeRecursiveAbsentOrFailedControl().nodeRecursiveAbsentOrFailedControl(i);
for(int m = 0;m<recursiveChildNode.size();m++)
recursiveChildElement = recursiveChildNode.getAbsentOrFailedControlsElementAt(m);
if(recursiveChildElement.getCheck())
//New line in the "table":
rootCause = new Bapi1240_Rc();
rootCause.setFunction("009");
rootCause.setHierarchy_Key("EHS_IAL_STD");
rootCause.setNode_Key(recursiveChildElement.getNODE_ID());
rootCause.setRef_Recno(wdContext.currentHeader_GDElement().getRecord_No());
rootCause.setRef_Object("IAL");
rootCause.setRef_Recno_Smeas("0");
rootCause.setPrimarykey("00000000000000000001");
rootCause.setForeignkey("00000000000000000001");
rootCause.setFlgfrgnkey(true);
rootCause.setFlgprimkey(true);
rootCause.setFlag_Selected(true);
//add the line to the "table":
createInput.addRootcause(rootCause);
}//end if
}//end for
}// end for
// execute:
wdContext.currentBapi_Bus1240_Create_InputElement().modelObject().execute();
// invalidate the output structure:
wdContext.nodeOutput_Create().invalidate();
} catch (CMIException ex) {
msgMgr.reportException(ex.getLocalizedMessage(), true);
//@@end -
I am new at working with XML in flash (or XML with anything
for that matter)
I want to loop through the following schema and have a list
of all employees and attached specifics can anyone point me in the
right direction?First, depends on what version of actionscript you are using.
If you are already using AS3, xml parsing is MUCH easier.
If you are still using AS2, you will need to write a parser.
Take a look at XPath's API. You can loop through multilevel XML
using some of its functions. But... get ready to code! :) -
Can anybody help me with an example or materail which explains how can we loop through a block in Forms 6i?
Also how we can loop through the details block pertaining to the master block and process those records also?
ThanksThe quickest way to do something is not to do it at all, and this looks like a good example of where you don't need to do anything - what I suspect you really need is a better design for your schema. What are you updating that requires an update on all child records and cannot simply be referenced when you query a child record?
If you can't change the schema and you have millions of records to update then your best bet is to use sql, then try pl/sql if sql can't do the job. Only try forms if you absolutely have to, and expect it to run like a brick.
In forms (assuming you're using relationships):
go to each block, do first_record and process each record.
go to the lowest child block and loop through the records using next_record until "system.last_record = 'TRUE'", processing each record as you go.
go to the next block up, do next_record and process that record.
go back to the lowest child block and loop though it, processing each record.
when you have reached the last record in the penultimate child block then go to its immediate parent block, do next_record and process that record.
go to the lowest child block etc etc etc
There are a lot of things which you can do in forms but which belong on the database! -
Looping through a string to search for a number?
I've been trying to use substr to loop through some text in a textfield I have cast as number. Although there is a problem with this, substr only goes through strings so if I type something as a number, it wont loop through t. Is there a similar function to loop through numbers?
use the string methods to find what you're looking for. you can cast as a number when you've finished using the string methods.
or, you can use the regular expression class. -
Hello everyone,
I have some troubles looping through a List using JSTL.
I have a List (itemList) of ItemConfiguration objects stored in session that i want to loop through. This is what i got so far:
<table width="200" border="0" cellpadding="0" cellspacing="0">
<jsp:useBean id="itemList" class="" scope="session" />
<c:forEach items="${itemList}" var="itemConfig">
<tr>
<td width="5"><img src="images/pixel.gif" width="1" height="2" /></td>
<td width="190"><img src="images/pixel.gif" width="1" height="2" /></td>
<td width="5"><img src="images/pixel.gif" width="1" height="2" /></td>
</tr>
<tr>
<td width="5"> </td>
<td width="190" align="center" class="menu"><c:out value="${itemConfig.name}" escapeXml="false"/></td>
<td width="5"> </td>
</tr>
</c:forEach>
</table>ItemConfiguration class have get/set methods (getName()/setName())
Can someone help me? im stuck at this and can�t make it work.
Thanks in advanceTry like this,
<logic:iterate id="myArray" property="itemConfig" Collection="<%=itemList%>">
<bean:write name="myArray" property="name" filter="false"/>"
</logic:iterate>
{code} -
Loops in arrays or structures
I was given a project on html reports and
They have advised me to use Loops in arrays or structures
At this point I am a novice at this html reporting system. I
would like to know how I can use loops in arrays or structures.
How is it beneficial are
1. Structures
2. Arrays
3. loops in for both
for my reports.
Countless thanks in advanceStructures are great if you understand them, they are
basically just arrays organized by keywords rather than index
numbers.
Arrays are very nice, as you can just run through loops to
access each element, as they are all indexed by numbers 0-x.
loops are great to navigate through both. All you have to do
is set an loop to run through x amount of iterations of the array
or structure (where x is the length of the array, or number of
elements in the structure). Loops are great due to the small amount
of code they require.
Maybe you are looking for
-
I just registered with Skype and ordered and paid for the 400 min monthlly subscription. I also ordersd the "World package" with a free trusl in the first month, but cancelled this later succesfully because there is no free calling to mobile numbers.
-
Deleting the date before time in a column
Hi guys, I am currently cleaning up alot of data and have come across a problem. I have a starting_time field of date datatype which is suppose to contain a list of times such as 23:30:00 or 10:45:00 etc. My issue is that all the times in this field
-
Pdfmaker fails converting folders
Team, I have a client using PDFMaker, version 9 with Acrobat Std 11. She uses PDFMaker to convert entire folders in Outlook. Recently, its started failing during the conversion process with as few as 200 items in the folder. I'm not finding anyth
-
Hi, Weblogic throws the following exception when the JMS Server do not return messages. Any idea,the Weblogic server do not shutdown, but it increases the Queue Length Thanks in avance weblogic.utils.
-
HT4721 why don't I see a top toolbar in itunes?
When I open up iTunes I do not have a toolbar at the top of the display so there is no "search" box. How do I display the usual toolbar?