Picking Individual Records in a loop
Hi,
Can any one suggest me how to pick and display individual records within a loop.
The records are inputed as a Collection and I want to pick the records one by one from the collection
After follow the suggestion the AshishSharma to manipulate individual records through the index, example:
bpws:getVariableData('SelectAllLegado_OutputVariable','FornCollection',concat('/ns3:FornCollection/ns3:Forn[',bpws:getVariableData('count'),']/ns3:cdForn'))
The count is variable the control while.
The cdForn is data recovered.
This is recovered with a assign.
Similar Messages
-
Picking Individual Records from Transform Activity
Hi ,
Can anyone suggest me how to pick individual records from the transform activity.
The Output of Transform Activity is as follows
<InvokeInsertServiceInputVariable><part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="DeptCollection"><DeptCollection xmlns:ns2="http://xmlns.oracle.com/pcbpel/adapter/db/top/InsertService" xmlns="http://xmlns.oracle.com/pcbpel/adapter/db/top/InsertService">
<ns2:Dept>
<ns2:deptno>77</ns2:deptno>
<ns2:dname>Cafetaria</ns2:dname>
<ns2:loc>Chennai</ns2:loc>
</ns2:Dept>
<ns2:Dept>
<ns2:deptno>88</ns2:deptno>
<ns2:dname>HelpDesk</ns2:dname>
<ns2:loc>Whitefield</ns2:loc>
</ns2:Dept>
</DeptCollection>
</part></InvokeInsertServiceInputVariable>
I want to pick deptno 77 & 88 individually.Count the number of records that you have using a count() function. This function returns the number of nodes of a particula xml element.
Initialize iterator variable with 1.
start a while loop with condition iterator<=count
<begin of while loop>
do your activities
increment the iterator
<end of while loop>
in your case
deptcolletion/dept[iterator] gives you a handle of every node.
Check out the xpath tutorial from w3schools.com . that will help
Message was edited by:
AshishSharma -
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 -
JCA Polling Adapter not picking up records
Hello All
I have been trying to configure a JCA polling adapter to pick up records from the Database, the first time I configured it, it read a whole bunch of records. Now I have configured the following in the database and am getting no records being polling.
1. Poll for new or changed records
2. Update a field in the table F40g02 for logical delete
3. Read value = READ, UNREAD value = UNREAD, Reserved value = RESERVED
4.Polling interval 5 seconds, Database XROWS per xml document 1, Database Rows per Transaction 10
I ran the SQL specified in the adapter and I get a record. Does anyone have any idea.
I have seen this warning in the EM
Database Adapter <oracle.tip.adapter.db.inbound.IPAddrPollingService getUniqueMarkReservedValue> The markReservedValue of distributed polling might not be a unique value. To make it so, you can add the last x digits (default = 2) of the host IP address using this format for the MarkReservedValue: [original_val]${IP[-x]}
RegardsHello
The problem I am facing is I can't get the records that are processed (already READ) to not poll again despite the value being changed to the READ value configured, if I set the READ value in the configuration it will poll every record all the time despite the fact it is equal to the READ value. Then if I set the READ value and any other value no records will poll.
Consider 4 records in the DB (currently in test I have 431 but I have used distributed locking and ReturnSingleResultSet to limit it)
ID = 1, STATUS = PROCESSED
ID = 2, STATUS = UNPROCESSED
ID = 3, STATUS = UNPROCESSED
ID = 4, STATUS = OTHER
Config 1: If READ = PROCESSED records 1,2,3,4 will poll
Config 2: If READ = PROCESSED, UNREAD = UNPROCESSED no records will poll
Config 3: If READ = PROCESSED, UNREAD = UNPROCESSED, RESERVED = OTHER no records will poll
Config 4: If READ = PROCESSED and TOPLINK STATUS not equal string "PROCESSED" then records 1,2,3,4 will poll
What I want is Record 2 and 3 to poll which I believe is config 3 should do. However I believe there have been some changes that relate to distributed polling for clusters in 11.1.1.3 onwards which means in jdeveloper (11.1.1.6) when I go to re-config the db adapter after setting the RESERVED value it disappears from the editor .
JCA properties obviously with a MarkReservedValueand MarkUnreadValue column jumping in.depending on which config I am trying
<property name="DescriptorName" value="dbPollBlockRecords.F40G02"/>
<property name="QueryName" value="dbPollBlockRecordsSelect"/>
<property name="MappingsMetaDataURL" value="dbPollBlockRecords-or-mappings.xml"/>
<property name="PollingStrategy" value="LogicalDeletePollingStrategy"/>
<property name="MarkReadColumn" value="STATUS"/>
<property name="MarkReadValue" value="PROCESSED"/>
<property name="PollingInterval" value="700"/>
<property name="MaxRaiseSize" value="1"/>
<property name="MaxTransactionSize" value="10"/>
<property name="NumberOfThreads" value="1"/>
<property name="ReturnSingleResultSet" value="true"/> (This property has been manually configured, will unfortunately poll all records that match without it)
Regards -
XI: Sender JDBC Communication Channel is not getting picked the records
Hi All,
Here I 'm facing an Issue with my sender JDBC communication Channel. Previously it was working fine but It is not Picking the records from the JDBC table.
Communication Channel is in active mode only.
I have checked in RWB communication Channel monitoring there i didn't get any error or success messages but channel is showing healthy status only(Green)
But i had created the new communication channel..with the same parameters which are in the older communication channel.. and sender agreement level also i had changed.. so now new channel is working fine.... I didn't understand what is the problem with previous communication channel.
ThanksHi yadav,
do you have TWO CCs polling at the same time via JDBC?
This could be the problem --> a conflict between both CCs.
Switch off ONE CC:
Regards Mario -
Using the follwing query
select distinct code from oalr where code > '" & AlertCode & "' and code<=('" & code & "') "
i got 5 records eg :5603,5604,5605,5606,5607
record set fetching
Ocode = CStr(rs4.Fields.Item(0).Value)
Here Ocode get only last record eg :5607, i want to take this 5 records in the loop how can i write the codingThank for ur reply,
But i not passing this in to matrix , i m going to pass the value in to anothe record set
eg
Ocode = CStr(rs4.Fields.Item(0).Value)
select A.code,A.MsgData,B.UserSign,C.Portnum as MobileNum from OALR A inner join ALT1 B on A.Tcode=B.code inner join OUSR c on C.UserID=B.UserSign where A.code='" & Trim(Ocode) & "' ")
I want to pass the Ocode value in to the loop.becoz only one value pass this query next time pass means duplicate value prob occure so i want to pass the Ocode value up to EOF. Give some solution -
How to get the individual records
Table A
SNO DAY_FROM DAY_TO
1 1 3
Result:
DAY_FROM DAY_TO
1 3
2 3
3 3
Above mentioned Table DAY_TO value is 3 ,
So in that How to get the 3 individual records for above mentioned row.
Thanks in advance.
Edited by: UserK on Sep 11, 2009 8:14 AM1 with t as
2 ( select 1 day_from, 3 day_to from dual)
3 select day_from +level -1 day_from, day_to
4 from t
5* connect by level <= day_to
SQL>
SQL>/
DAY_FROM DAY_TO
1 3
2 3
3 3 -
Hi,
I am working with JMS adapter as a sender.
The issue is the adapter is picking multiple records at time, where the requirement is to pick up only one record at a time (ie.., when the record has entered the queue).
The occurence state is already set to 1..1.
Please let me know the possible changes to do .
Thanks and Regards,
Manoj KumarHi,
Check the Sender side structure , and see the below links
/people/alessandro.guarneri/blog/2006/01/04/jms-sender-adapter-handling-too-short-lines
/people/william.li/blog/2006/11/13/how-to-use-saps-webas-j2ees-jms-queue-in-exchange-infrastructure
content conversion
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/f02d12a7-0201-0010-5780-8bfc7d12f891
Regards
Chilla -
Delta Upload picking no records
Dear All,
I have problem with delta upload, Intialize upload is happening but delta upload not picking the records but it is showing green signal with 0 records.
DataSource : 0CRM_SRV_PROCESS_H
the delta type for the datasource is AIMD.
I am really not very sure if my datasource supports delta.
I am pulling data from Solution MANAGER.
Please guide..
Thanks,
SGK.
Message was edited by: SGKHi,
Check your datasource in RSA2 there you can check whether or not it is delta enabled also you can check in rsa3.
Hope this helps
Assign points if useful
Regards,
venkat -
Getting individual records in st03.
Hi,
Can anybody let me know how to drilldown for individual records in st03 tcode like stad ?
Thanks in Advance,
ArchanaI need to display logo on top of the report, for that reason i have included one database table and mapped it against POJO class in the report file.
So because of this additional table, iam getting each record repeated thrice in the report.........Is there any other way of displaying image in the report using POJO class in crystal report -
Comparing two tables and picking the records
I have two tables A and B. I have to compare a column ID in both table A and table B A.ID=B.ID And based on the above comparison if the match is found I need to pick the records from table A and if no match then need to pick the records from table B My problem is if I join then I will have table A and table B as one record and will be difficult to separate out. Please let me know how this can be acheived. Thnx.
I have two tables A and B. I have to compare a column ID in both table A and table B A.ID=B.ID And based on the above comparison if the match is found I need to pick the records from table A and if no match then need to pick the records from table B My problem is if I join then I will have table A and table B as one record and will be difficult to separate out. Please let me know how this can be acheived. Thnx.
-
Assign value to a record in a loop?
I have the record as following:
TYPE Curr_Select_Rec IS RECORD
ser_date date,
blk_route varchar210)
p_select Curr_Select_Rec;
How do I assign value to it in a loop?
I know I can do this
p_select.blk_route := 'aaaa';
but in the loop
Loop
How??????
end loop;
NEXT, LAST, FIRST Did not work
nullHi,
here a little package I wrote to select a table into a plsql_table and to work with the pl/sql table .
Package STIL_utils
IS
type r_export_tags is record
(bezeichnung stilvorlagen.bezeichnung%TYPE,
start_tag stilvorlagen.text_beginn%TYPE,
end_tag stilvorlagen.text_ende%TYPE);
type t_export_tags is table of r_export_tags
index by binary_integer;
procedure fill_tag_table(p_export_tags in out t_export_Tags,
p_export_typ in varchar2);
procedure show_tag_table(p_export_tags in t_export_Tags);
procedure find_tag(p_export_tags in out t_export_tags,
p_export_typ in varchar2,
p_tag_typ in varchar2,
p_start_tag in out stilvorlagen.text_beginn%TYPE,
p_end_tag in out stilvorlagen.text_ende%TYPE);
END; -- Package Specification UTL_STIL
Package Body STIL_utils
IS
-- Stilvorlagen Array
procedure show_tag_table(p_export_tags in t_export_tags)
is
v_index number;
v_index_last number;
begin
v_index := p_export_tags.first;
v_index_last := p_export_tags.last;
loop
dbms_output.put_line(p_export_Tags(v_index).bezeichnung);
dbms_output.put_line(p_export_Tags(v_index).start_tag);
dbms_output.put_line(p_export_Tags(v_index).end_tag);
exit when v_index = v_index_last;
v_index := p_export_Tags.next(v_index);
end loop;
end;
procedure fill_tag_table(p_export_tags in out t_export_Tags,
p_export_typ in varchar2)
is
cursor tags is
select bezeichnung,text_beginn,text_ende
from stilvorlagen
where bezeichnung like p_export_typ| |'_%'
and loesch_kz is null;
v_count number := 0;
--Prozedur zur Ermittlung welche Tags verwendet werden sollen.
-- Aus der Tabelle Stilvorlagen wird ein Array mit den Start und
--Ende Tags des entsprechenden Export Typs gef|llt.
begin
for rec in tags
loop
p_export_tags(v_count).bezeichnung := rec.bezeichnung;
p_export_tags(v_count).start_tag := rec.text_beginn;
p_export_tags(v_count).end_tag := rec.text_ende;
v_count := v_count + 1;
end loop;
--show_tag_table(p_export_tags);
end;
procedure find_tag(p_export_tags in out t_export_tags,
p_export_typ in varchar2,
p_tag_typ in varchar2,
p_start_tag in out stilvorlagen.text_beginn%TYPE,
p_end_tag in out stilvorlagen.text_ende%TYPE)
is
v_index number;
v_index_last number;
v_bezeichnung stilvorlagen.bezeichnung%TYPE;
begin
v_index := p_export_tags.first; --Arrayindex setzen
v_index_last := p_export_Tags.last; --Abbruchkriterium ermitteln
p_start_tag := null;
p_end_tag := null;
loop
v_bezeichnung := p_export_tags(v_index).bezeichnung;
-- Ist das der richtige Tag?
if v_bezeichnung = p_export_typ| |'_'| |p_tag_typ then
p_start_Tag := p_export_tags(v_index).start_Tag;
p_end_Tag := p_export_tags(v_index).end_Tag;
-- Tag gefunden also raus
exit;
else
-- Wenn alle getestet, dann raus
exit when v_index = v_index_last;
-- Ndchstes Feld aus Array
v_index := p_export_Tags.next(v_index);
end if;
end loop;
end;
END; -- Package Body UTL_STIL
Hope that helps
Detlev
null -
How to display more than one Record in a Loop
Hi ,
This procedure will return more than one data .
so please tell me how can i write a loop to display all the records of a Table .
This is my procedure :
create or replace procedure getEmpName
V_EMPID IN employee.EMPID%TYPE,
V_EMPNAME OUT employee.EMPNAME%TYPE
is
begin
select empname into V_EMPNAME from employee where empid='2';
end ;
This is my block : How to write a loop here to display all records of my Table
declare
v_EMPNAME EMPLOYEE.EMPNAME%TYPE;
begin
getEmpName(2, v_EMPNAME);
dbms_output.put_line(v_EMPNAME);
enduser10503747 wrote:
so please tell me how can i write a loop to display all the records of a Table .hi,
given procedure will display all records of emp table...
CREATE OR REPLACE PROCEDURE Testloop
AS
CURSOR test1
IS
SELECT EMPNO, ENAME FROM EMP;
BEGIN
FOR i IN test1
LOOP
DBMS_OUTPUT.PUT_LINE ( 'Emp - '||i.empno ||'-'||i.ename );
END LOOP;
END;
Thnx
MB -
Need to insert a multiple select list as individual records
i have one list that is popluated with names and the names
have a unique number assigned to them
The other list is populated with county names and they also
have a number assigned to them
As the code is now it will not work because, the loop is in
the wrong place, I think??
CF throws an error saying invalid data type because it is
trying to insert "1,2,3,4,5,6,etc..."
I changed the data type to text so it would atleast accept
the insert, which worked but that is not what i want. I then
changed it backed to numeric, but get the invalid data type error.
The database would look like this if changed to text data
type:
personnel_ID countyID
1 1,2,3,4,5,6
i want it to look like this:
personnel_ID countyID
1 1
1 2
1 3
1 4
1 5
etc.....
I somehow need a loop to check and see if a county is
selected and then insert the personnel_ID and countyID into one
record, then check the next county and so on.
below is my code.........Any help would be greatly
appreciated
<cfset CurrentPage=GetFileFromPath(GetTemplatePath())>
<cfif IsDefined("FORM.MM_InsertRecord") AND
FORM.MM_InsertRecord EQ "form2">
<cfquery datasource="wildlife_nwco"
name="insertCounties">
<cfloop index="listElement" list="#form.countyID#">
INSERT INTO countiesWorked (personnel_ID, countyID)
VALUES (
<cfif IsDefined("FORM.personnel_ID") AND
#FORM.personnel_ID# NEQ "">
<cfqueryparam value="#FORM.personnel_ID#"
cfsqltype="cf_sql_numeric">
<cfelse>
NULL
</cfif>
<cfif IsDefined("FORM.countyID") AND #FORM.countyID# NEQ
"">
<cfqueryparam value="#FORM.countyID#"
cfsqltype="cf_sql_numeric">
<cfelse>
NULL
</cfif>
</cfloop>
</cfquery>
</cfif>
<cfquery name="personnel" datasource="wildlife_nwco">
SELECT *
FROM personnel
ORDER BY personnel.lastName
</cfquery>
<cfquery name="county" datasource="wildlife_nwco">
SELECT *
FROM countyID
ORDER BY countyID.countyName
</cfquery>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body>
<form method="post" name="form2"
action="<cfoutput>#CurrentPage#</cfoutput>">
<table align="center">
<tr valign="baseline">
<td nowrap align="right">Name of NWCO::</td>
<td><select name="personnel_ID">
<cfoutput query="personnel">
<option value="#personnel.personnel_ID#" <cfif
(isDefined("personnel.personnel_ID") AND personnel.personnel_ID EQ
personnel.personnel_ID)>selected</cfif>>#personnel.lastName#,
#personnel.firstName#</option>
</cfoutput>
</select>
</td>
<tr>
<tr valign="baseline">
<td nowrap align="right">Counties Worked:</td>
<td><select name="countyID" size="10"
multiple="multiple">
<cfoutput query="county">
<option value="#county.countyID#" <cfif
(isDefined("county.countyID") AND county.countyID EQ
county.countyID)>selected</cfif>>#county.countyName#</option>
</cfoutput>
</select>
</td>
<tr>
<tr valign="baseline">
<td nowrap align="right"> </td>
<td><input type="submit" value="Insert
record"></td>
</tr>
</table>
<input type="hidden" name="MM_InsertRecord"
value="form2">
</form>
<p> </p>
</body>
</html>You are on the right track. Most dbs do not allow mulitple
queries in a single cfquery tag. Put your query in the loop instead
of the the loop in the query. Also, your countyid will be
ListElement, not form.countyId. -
Problem in moving to next record in For Loop end loop construct
Hi friends i have the followind code in my stored proc. I am reading each row in the temprec and then based on the variable "i_copy_notes" processing the record. If the value of the I_copy_notes" varialble is 1 then i need to move to next record. when I am using "Next" then the compiler is telling me that the "NEXT" must be declared. Please advise.
FOR TEMPREC IN
SELECT
DP_SER,
GRD_POS,
TS_POS,
ASG_ID,
DESCS,
GRD_ID
FROM DCGRD_POS
WHERE CLLI = i_FROM_CLLI AND SUBSYS = i_SUBSYS AND BAY_ID = v_OLD_BAY_ID ORDER BY GRD_ID
LOOP
IF v_OLD_GRDID = TEMPREC.GRD_ID THEN
v_NEW_GRDID := v_NEW_GRDID;
IF i_COPY_NOTES = 1 THEN
Next;
END IF;
ELSE
v_OLD_GRDID := TEMPREC.GRD_ID;
SELECT DCGRD_POS_GRD_ID.NextVal INTO v_NEW_GRDID FROM DUAL;
END IF;
INSERT INTO DCGRD_POS VALUES
i_TO_CLLI,
DCGRD_POS_ROW_SER.NextVal,
TEMPREC.DP_SER,
v_NEW_GRDID,
v_NEW_BAY_ID,
TEMPREC.GRD_POS,
DECODE(i_COPY_NOTES,1, TEMPREC.TS_POS,''),
TEMPREC.ASG_ID,
DECODE(i_COPY_NOTES,1,TEMPREC.DESCS,'UASGN'),
i_CURRENT_ISSUE,
-1,
i_SUBSYS,
SYSDATE,
i_USERID
END LOOP;
Line # = 315 Column # = 10 Error Text = PLS-00201: identifier 'NEXT' must be declared
Line # = 315 Column # = 10 Error Text = PL/SQL: Statement ignored
----------------------------------------------Personally, I'm not a big fan of this technique but you can use a goto ...
begin
for i in 1.. 10 loop
if i < 5 then
goto end_of_loop;
end if;
dbms_output.put_line(i);
<<end_of_loop>>
null;
end loop;
end;
Maybe you are looking for
-
trying to determine which would give me the best resolution. video card has 2 dvi and 1 micro hdmi outs; monitor has 2 regular hdmi and 1 vga. would the micro hdmi to a regular hdmi work best or would a dvi to hdmi give better resolution. getting
-
Will I lose my unlimited data plan if I upgrade to new iPad
I am grandfathered in to the unlimited data plan on AT&T. Will that carry over to the new iPad? When I sent from iPad to iPad 2 all I had to do was swap my SIM into the new iPad, but wouldn't I need a new SIM for 4G?
-
CFCHART, y axis in whole numbers?
I have a report I print tracking the number of events in different categories. Events are single items and never parts of items. The charts I am generating have the y axis divided in all different ways. Is there a way to force the y axis to be whole
-
I can't read piece jointe to a message
I can read e-mail but I can't read the document's joint
-
Primary drive on a Mac Mini server ?
Hi all: When I first picked up my 2011 mac mini server I immediately reformatted the drives and created a Riad 1 array. After a while, I decided to go back to a two disk arrangement. Since then my mini have worked OK but sometimes drops connection