Single Record Works. All Not Workss. [message #583814] |
Sat, 04 May 2013 10:53 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
shahzad-ul-hasan
Messages: 625 Registered: August 2002
|
Senior Member |
|
|
Respected
i am facing the problem. please see the attached file.the comp_code record on right side is working fine everytime i changed the comp_code. but when i press button send to all it gives me error.
..........Frm-40735...........Ora-01422
When Button press code:..........
DECLARE
B VARCHAR2(30);
A VARCHAR2(30);
BEGIN
SELECT DISTINCT COMPUTER_CODE INTO B FROM FEE WHERE STATAS='present';
SELECT DISTINCT MOBILE INTO A FROM FEE3
WHERE FEE3.COMPUTER_CODE=B;
IF :MSGALL = 'Yes' Then
Loop
INSERT INTO MSGOUT (IID,MSGTO,MSG)
VALUES
(B,A,:MSSG);
COMMIT;
NEXT_ITEM;
EXIT;
END LOOP;
ELSE
NEXT_ITEM;
END IF;
END;
please help me to remove ambeguity.
-
Attachment: 1.JPG
(Size: 25.64KB, Downloaded 784 times)
|
|
|
|
Re: Single Record Works. All Not Workss. [message #583819 is a reply to message #583817] |
Sat, 04 May 2013 21:47 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
shahzad-ul-hasan
Messages: 625 Registered: August 2002
|
Senior Member |
|
|
SIR
i have made some adjustment in the code.please review it is correct.
------------------------------------------------------------
DECLARE
B VARCHAR2(30);
A VARCHAR2(30);
CURSOR CC IS
SELECT DISTINCT COMPUTER_CODE,MOBILE FROM FEE3
WHERE FEE3.COMPUTER_CODE IN (SELECT DISTINCT COMPUTER_CODE FROM FEE WHERE STATAS='present');
BEGIN
OPEN CC;
LOOP
FETCH CC
INTO A,B;
:A:= A; :B:= B;
IF :MSGALL = 'Yes' AND :COM_CODE IS NULL Then
INSERT INTO MSGOUT (IID,MSGTO,MSG)
VALUES
(A,B,:MSSG);
COMMIT;
END IF;
EXIT WHEN CC%NOTFOUND;
END LOOP;
NEXT_RECORD;
CLOSE CC;
END;
its works what i want from this function but pls see the attached file.it shows me the dialouge box which i want not to be shown.
----------------------------------------
-
Attachment: 2.JPG
(Size: 34.08KB, Downloaded 764 times)
[Updated on: Sat, 04 May 2013 23:23] Report message to a moderator
|
|
|
Re: Single Record Works. All Not Workss. [message #583824 is a reply to message #583819] |
Sun, 05 May 2013 04:24 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
cookiemonster
Messages: 13937 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
shahzad-ul-hasan wrote on Sun, 05 May 2013 03:47SIR
i have made some adjustment in the code.please review it is correct.
We know nothing about your tables, or their data, or how they are related to each other.
Also we have no idea what your code is supposed to do.
So how could we possibly know if your current code is correct?
I will say that you should read up on cursor for loops, and that proper programmers always give variables meaningful names instead of a and b.
shahzad-ul-hasan wrote on Sun, 05 May 2013 03:47
its works what i want from this function but pls see the attached file.it shows me the dialouge box which i want not to be shown.
You can change system.message_level to hide that.
|
|
|
|