How to check two contitions in for loop
Hello all
Here I am having a for loop where I am reading from a cursor and I want to run this loop
till the number in :P102_NO
FOR emp_rec in emp_cur and i in 1 to :P102_NO loop
insert into EMP(EMP_ID,DEATH_DATE) values(emp_rec.emp_id,:P102_DATE)
end loop;
but it is showing a error:
ORA-06550: line 5, column 24: PLS-00103: Encountered the symbol "AND" when expecting one of the following: . ( * @ % & - + / at loop mod remainder rem .. || multiset
do anybody have any idea about it?
Thanks
Tauceef
Tauceef wrote:
Hello all
Here I am having a for loop where I am reading from a cursor and I want to run this loop
till the number in :P102_NO
FOR emp_rec in emp_cur and i in 1 to :P102_NO loop
insert into EMP(EMP_ID,DEATH_DATE) values(emp_rec.emp_id,:P102_DATE)
end loop;
but it is showing a error:
ORA-06550: line 5, column 24: PLS-00103: Encountered the symbol "AND" when expecting one of the following: . ( * @ % & - + / at loop mod remainder rem .. || multiset
do anybody have any idea about it?
Thanks
TauceefYou would need 2 loops, but the ideal way to do this would be in a single SQL statement... no loops, no cursors.
FOR emp_rec in emp_cur
LOOP
FOR i in 1 to :P102_NO
LOOP
<stuff and or things>
END LOOP;
END LOOP;However you aren't making reference to your variable (i) anywhere ... so what exactly are you trying to do?
How about you show us your cursor, the data you have ... and the data you want when whatever the heck you're trying to do 'works'. We'll be in a much better-er position to help you in that case.
Similar Messages
-
How to check plan line items for plan cost at network activity level?
Dear all,
How to check plan line items for plan cost at network activity level? The plan cost is done in network activity in CJ20N.
I am not able to check using CJI4 or CJI9 report.
Kindly advise.
Thanks and regards,
JessieHi Jess,
Have you checked the navigation part which is being displayed on left hand side of report S_ALR_87013565 and S_ALR_87013533.? There you have option to check transaction currency and object currency when you double click on it.
In case if it is not being displayed under navigation. Then you can bring them on from transaction code CJE2. For eg: Report group for S_ALR_87013533 is 12KST1C. Double click on it and it will open up to do changes in report layout and many more. There you also have options to bring on transaction currency too. Similarly, you can check for other report groups as well just by checking the report description.
But I am not sure if suits your requirements. Wait for other experts to comment on this.
Regards,
Amit -
How to Maintain two different prices for same material in different qty?
Dear all,
How to maintain two different prices for same material in different batch quantities in purchase order(ie.,info record)?
(Vendor is supplying quantities in 2 different batches & also in different prices)
Expecting valuable reply.
JeyakanthanIn a PO you can create 2 items, and each item can be maintained with a different price in the conditions.
In info record it is not possible to have different prices for the same period, except for scales.
so if you have a price of e.g. 2 USD for 1000 kg and 1,90 USD for 2000 kg then you can maintain this in scales, but you still have to have 2 items in the PO so that each one can individually find its price.
Alternative you can create contracts (as well with more than one item) to reflect the different prices and batches. -
How to check a pdf uploaded for press in a website automatically ??
how to check a pdf uploaded for press in a website automatically ??
i am making a new website for a printer.. his client upload pdf online directly in his website, we want that in the case that the pdf is not
as the printer need it for printing , the site automaticly after checking the pdf profile uploaded open a window and write what is wrong with this pdf
and if possible fix what he can fix automaticly as pitstop software is doing offline.
PLEASE YOUR HELP
thank you in advanceAcrobat isn't available with a server license. You might like to look into PitStop Server.
-
How to check the Statistics generated for a table through DBMS_STATS.
Hi,
How to check the statistics generated for a Table through DBMS_STATS.GATHER_TABLE_STATS procedure ?
Please let me know.
Thanks !
Regards,
RajasekharRajasekhar wrote:
Hi,
How to check the statistics generated for a Table through DBMS_STATS.GATHER_TABLE_STATS procedure ?
Please let me know.
Thanks !
Regards,
Rajasekharquery ALL_TABLES -
How to check the tran code for specific activity.
Hello friends ,
could you please let me know how to check the tran code for specific activity . AS in table , i can check , what transaction does what ? But now i need to check the transaction for specific activity .
E.g , For Administrator workbench , there is transcation like RSA1 .
thanks in advance
RegardsHi,
try the TSTC table with SE16.
Hope it helps,
MG -
How to let " i " of a for loop to start from a "X"
Hi,
how to let " i " of a for loop to start from a value "x" where x is a variable?
Thx
Message Edited by starfish on 10-19-2007 06:00 AMHi starfish,
use it like this:
If this doesn't fit your needs you should attach an example of what you really need!
Message Edited by GerdW on 10-19-2007 01:15 PM
Best regards,
GerdW
CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
Kudos are welcome
Attachments:
I.png 2 KB -
Please help me.. how to rewrite the following java- for loop code in ada
int i, j, n = 100;
for (i = 0, j = 17; i < n; i++, j-- )
sum += i * j + 3;how to rewrite the following java- for loop code in ada
You should have a programming manual for Ada first. If you mean it the other way round, I think you subject line confused me. -
How to check a XMLTYPE table for corrupted (not invalid!) XML records ??
Hello,
I'd like to get help on the following issue, please. I need to check the XML data in a number of tables with XMLTYPE data type. Some of the data is corrupted but in terms not that the XML format is wrong but there is no XML at all in the fields but just only, for example, control characters (no tags, no anything, just corrupted data).
So, I have made a PL/SQL procedure cursor to get all the tables from a list, and then another cursor inside to browse each table for corrupted records. But can you help me how to check this? Any of the XML functions like for example: XMLIsValid, isFragment(), getrootelement(), etc. return to me an Oracle error "ORA-31011 XML parsing failed" and the procedure gets stuck on the first found bad record. But I need to continue and check all of them. Is it possible to get the ORA-31011 error with EXCEPTION, write to a logging table the corrupted record ID, and then continue?
Here is my simple procedure:
CREATE OR REPLACE PROCEDURE CHECKXML (v_schema in VARCHAR2)
IS
v_Message VARCHAR2(254);
sql_stmt1 VARCHAR2(1000);
sql_stmt2 VARCHAR2(1000);
c1 SYS_REFCURSOR;
c2 SYS_REFCURSOR;
cur_tab varchar2(100);
cur_appl varchar2(100);
cur_rec varchar2(200);
valid_flag number;
criteria VARCHAR2(20);
tab1 VARCHAR2(20);
tab2 VARCHAR2(20);
BEGIN
criteria := 'XMLTYPE';
sql_stmt1 := 'select id, path from ' || v_schema || '.stubfiles where type=:bcriteria';
open c1 for sql_stmt1 using criteria;
loop
begin
fetch c1 into cur_tab, cur_appl;
exit when c1%notfound;
insert into system.log_table values (sysdate, v_schema, 'next table', 'id ' || cur_tab, 'appl ' || cur_appl, '');
sql_stmt2 := 'select t.recid, t.xmlrecord.isFragment() from ' || v_schema || '.' || cur_tab || ' t';
open c2 for sql_stmt2;
loop
begin
fetch c2 into cur_rec, valid_flag;
exit when c2%notfound;
insert into system.log_table values (sysdate, v_Schema, 'next record', 'id ' || cur_tab, 'recid ' || cur_rec, 'valid ' || valid_flag);
commit;
EXCEPTION
WHEN OTHERS THEN v_Message := sqlerrm;
dbms_output.put_line('Error for ' || cur_tab);
dbms_output.put_line('-' || v_Message);
insert into system.log_table values (sysdate, cur_tab, 'id err' || c_Row.ID,'appl err' || c_Row.path, v_Message,'');
end;
end loop;
close c2;
commit;
end;
end loop;
close c1;
commit;
END CHECKXML;
Thanks in advance
EvgeniHi
Why do you use a GTT? Just keep your xml in memory...
HTH
Chris -
How to pass parameter into cursor for loop ?
Hi Experts,
I want to pass parameter l_bom_header_tbl(i).assembly_item_name into the for statement below How to achieve this?
for j in 1 .. l_bom_components_tbl.COUNT LOOP
ThanksMaybe i failed to describe in detail,so here i go:
I have two for loops:
for i in 1 .. l_bom_header_tbl.COUNT LOOP --1st For Loop
V_bom_header_tbl.organization_code :='DSC';
V_bom_header_tbl.assembly_item_name:= l_bom_header_tbl(i).assembly_item_name ;
k:=1;
I want to pass parameter l_bom_header_tbl(i).assembly_item_name into the for statement below: How to achieve this?
for j in 1 .. l_bom_components_tbl.COUNT LOOP *2nd For Loop*
v_bom_components_tbl(k).Assembly_Item_name := l_bom_header_tbl(i).assembly_item_name ;
k := k + 1;
end LOOP;
end loop;
end;
I want to pass a paramter into second for loop in such a way that it accepts from the first for loop
for j in 1 .. l_bom_components_tbl.COUNT LOOP -2nd loop
Edited by: ILovePlSql on Mar 22, 2010 12:25 PM -
How to check two internal table fields
Hi all,
I need to check two internal table fields are equal or not means which statement i can use.
Not internal table ,table contents i need to check i.e
it1-pernr = it2-pernr.
like this
if i put loop it'll check one table field for one loop.
if i put two loop means some fields reflecting 2 in it1 then it'll pring 4 times like that.i want to print whatever in internal table only .
pernr(0001) two times there in it1 means
it1-pernr = it2-pernr then
it's printing
0001
0001
0001
0001
like this but actually in it1 only two records.
Anybody know solution.tell me.
Thanks
Regards,
NandhaHi,
code for your view
data : begin of it1 occurs 0,
z_pernr like pa9012-pernr,
z_fac_c like pa9012-zz_fac_c,
end of it1.
data : it2 like Zsc1 occurs 0 with header line,
It1 data
pernr FAC C
0001 5555
0001 5555
0002 4444
0003 3333
0006 8888
It2 data
pernr FAC C
0001 5555
0001 5555
0005 6666
0003 3333
output(My code)
loop at it2 .
loop at it1 where pernr = it2-pernr.
write:/01 it1-1pernr,
10 it1-z_fac_c.
endloop.
endloop.
out put i need.
0001 5555
0001 5555
0002 4444
0003 3333
Thanks,
Nandha -
How to maintain two credit limits for the same customer.
We have two lines of business for the same company code. One customer is trading in two lines of business.
We want to maintain two credit limits for same customer. How is this possible.Hi,
Credit Limits are assigned to customer master in a credit control area, so a customer can have different credit limits for the different credit control areas.
(Please note that Credit Control Areas are normally assigned to company codes or sales area.)
But if you are having only one credit control area, then only one credit limit can apply.
However you can use the user exits to put any check you want for the customer. There are various user exits available for it like LVKMPTZZ,LVKMPFZ1,LVKMPFZ2 and LVKMPFZ3 in transaction SMOD
Regards,
Gaurav -
How do I use an enhanced for loop / for each on my ViewObjectImpl ?
Guys and Gals,
With all of my newly acquired Java knowledge in tow, I spent this weekend cleaning up all of my code, dealing mainly with for loops. I converted them from a huge mess to a for each type loop using language such as ...
RowSet priceUpdateRows = (RowSet)((PriceUpdatesViewRowImpl) priceUpdate).getPriceUpdateRowsView();
for (Row priceUpdateRow: priceUpdateRows)
{ // do operations on row... which makes perfect sense to me. For each Row in the RowSet, do something. It doesn't, however, makes sense to the compiler. It pouts and gives me a "foreach not applicable to expression type" error. So I read up on iterators and such, messed with code examples, and still can't get the RowSet to iterate with the above code. Could I make RowSet implement Iterable? How would I do that? I tried to create a class called RowSetExt which extended RowSet and implemented Iterable, but then I got a class cast exception.
I know I could implement something like the following or a while(hasNext()) but they're really not what I'm looking for.
ViewObject vo = … < Get ViewObject > …
RowSetIterator rsi = vo.createRowSetIterator("rowsRSI");
while (rsi.hasNext())
Row row = rsi.next();
row.setAttribute("YourAttribute",your_value);
rsi.closeRowSetIterator();How do I make the for(Row row : <RowSet>) example work? Or could someone point me in a direction?
WillOne thing I tried was to make a framework extension class for my ViewObjectImpls
public class PcsViewObjectImpl
extends ViewObjectImpl
implements Iterable<Row>
Set<Row> set = new HashSet<Row>();
public Iterator<Row> getRows()
return set.iterator();
public Iterator<Row> iterator()
return getRows();
}AppModuleImpl
PriceUpdateRowsViewRowImpl priceUpdateRows = (PriceUpdateRowsViewRowImpl)((PriceUpdatesViewRowImpl) priceUpdate).getPriceUpdateRowsView();
for (Row priceUpdateRow: priceUpdateRows)
{However, this gives me a class cast exception at runtime. But I would think some kind of extension class would be the way to go ... ? -
How to terminate or exit a for loop when the user clicks on stop button
Actually my problem is to stop a loop when i click on stop button.
example:i have two buttons 'start' and 'stop'
in start buttom i wrote a for loop as
dim i as integer
For i=1 To 100000
print i
Next
when i click on start buuton it prints 'i' value up tp 100000.
my question is when i click on 'Stop' button the for loop has to terminate or Exit from the loop and should stops the execution.
Is it possible to termianate or Exit the 'for loop'
PS.Shakeer Hussain
HyderabadI am unable to stop the loop and application not at all allowing to Press the Stop button.
It seems like Hung, any advise ?
Private Sub btnStart_Click(sender As Object, e As EventArgs) Handles btnStart.Click
btnStop.Enabled = True
btnSelectFile.Enabled = False
btnStart.Enabled = False
btnStop.Focus()
Dim strFileName As String = txtFileName.Text.ToString
Dim strLineText As String
If System.IO.File.Exists(strFileName) = True Then
Dim objReader As New System.IO.StreamReader(strFileName)
While objReader.Peek() <> -1 And stopclick = False
strLineText = objReader.ReadLine()
MsgBox(strLineText, MsgBoxStyle.Information)
Application.DoEvents()
Thread.Sleep(My.Settings("strDelay") * 1000)
'System.Diagnostics.Process.Start(My.Settings("strFireFoxLocation"), strLineText)
End While
End If
End Sub
Private Sub btnStop_Click(sender As Object, e As EventArgs) Handles btnStop.Click
stopclick = True
btnSelectFile.Enabled = True
btnStart.Enabled = True
btnStop.Enabled = False
End Sub
Raman Katwal
Please remember to mark the replies as answers if they help and unmark them if they provide no help -
How to check the Datasource name for Virtual cube
Hello Experts,
I have a report which is built on one multiproviider for which we are getting balance sheet data reporting on company code,enduser told us that he wanted to see the data on plant level...
The problem here is that I have checked the data flow for the multiprovider,It is showing as getting data from virtual cube.
So,from there It is not showing the datasource and infosource under it(under virtual cube)..so how can I check the datasource name for it,so that I can go and enhance the datasource in case the plant(WERKS) is not there
thanks
reddyHi Friend,
go virtual cube lavel and see the data flow with "downward & upward" option in RSA1
Go to RSA1
Select the Virtual cube> right click > display data flow> select "downward & upward"
it may help you
Maybe you are looking for
-
Short code causes a strange problem - About the list again -- please read!
Hi again people. Maybe you remember my project - has a list, that you can search thru using a text field. During the work I got stuck on a strange problem ( Again :-( ) My app has one text field, one combo box, one list and a text field once more. Th
-
I have a link to pictures now I would like to have them open in a new window
I finally have a link to my pictures with the correct size. I think I want them to open in a new window. This would make it easier for people to go back and forth to different groups. Currently when I click on a link it shows the pictures in a sli
-
I'm trying to make a JFrame that will cycle through several Images (VCR-like). I've tried various methods, all with the same basic results. The image comes up fine, but the 4 buttons (first, previous, next, last) are all squished at the bottom (shoul
-
LSMW-IDOC error while tranferring data from ECC to CRM
Hi, We got an error Error status 'A' calling validation service. Validation error occured: "Module CRM_BUPA_MAIN_VAL, B Doc type BUPA_MAI". When we are doing LSMW with IDOC in CRM. Please provide ur valuable help in this problem. Thanks & Regards Sri
-
now i have pretty much created my site for desktop computers i want to create the same site for mobile phones just tweaking the layout slightly. i know you can add an alternative layout in muse, clicking copy from desktop and checking all 3 options g