Hi All,
I have two tables 1) In_decrement_base_ch -
MSC_ID VARCHAR2(20 ),
-
PLAN_ID VARCHAR2(20 ),
-
ACT_DATE DATE,
-
DUM VARCHAR2(5 ),
-
PADJ NUMBER(10,2));
-
-
2)
-
CREATE TABLE TMP_ADJ
-
(
-
MSC_ID NUMBER(20),
-
NOMINALAMOUNT NUMBER(20))
-
-
I have to comepare MSC_ID and update the Nominalamount in table1 (PADJ)column
-
-
This is the proc i have written
-
-
-
CREATE OR REPLACE procedure PRE_DECRE_CALC is
-
-
lcnt number(5);
-
TYPE ADJMOB IS TABLE OF tmp_adj.MSISDN%TYPE;
-
ADJMSISDN ADJMOB ;
-
-
TYPE ADJAMT IS TABLE OF tmp_adj.NOMINALAMOUNT%TYPE;
-
ADJNAMT ADJAMT;
-
-
-
-
BEGIN
-
-
SELECT COUNT(*) INTO LCNT FROM AUTO_SH_LOAD WHERE TRUNC(LOADDATE)=TRUNC(SYSDATE)-1
-
AND FILEGROUP IN ('CHPYMT','CHP2P','CHREFL','CHSTAT','CHADJ','CHCLCR','CHSFEE');
-
-
IF LCNT=7 THEN
-
-
DECLARE
-
-
CURSOR C1 IS
-
SELECT MSC_ID,SUM(NOMINALAMOUNT)
-
FROM tmp_adj A GROUP BY
-
MSC_ID;
-
-
-
BEGIN
-
OPEN C1;
-
LOOP
-
FETCH C1 BULK COLLECT INTO ADJMSISDN,ADJNAMT;
-
EXIT WHEN C1%NOTFOUND;
-
-
FORALL I IN ADJMSISDN.FIRST..ADJMSISDN.LAST
-
-
UPDATE IN_DECREMENT_BASE_CH V SET V.PADJ=ADJNAMT(I) WHERE V.MSC_ID=ADJMSISDN(I);
-
COMMIT;
-
-
-
END LOOP;
-
END;
-
END IF;
-
END;
-
/
Procedure got compiled but data is not getting updated in the table 1...
Am i making any mistake here if so pls correct me...
Note : (Auto_Sh_load is a temp log table)
2 1897
ananthaisin,
can you post the output of: -
SELECT COUNT(*)
-
FROM AUTO_SH_LOAD
-
WHERE TRUNC(LOADDATE) = TRUNC(SYSDATE) - 1
-
AND FILEGROUP IN ( 'CHPYMT','CHP2P' ,'CHREFL','CHSTAT'
-
,'CHADJ' ,'CHCLCR','CHSFEE')
-
;
-
edited:
I forgot, the output of -
select count(*)
-
from
-
( SELECT MSC_ID,SUM(NOMINALAMOUNT)
-
FROM tmp_adj A
-
GROUP BY MSC_ID
-
);
-
also.
Firstly, when you are using Fetch..BULK COLLECT clause then why you need a LOOP?
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Paul Rowe |
last post by:
Hi "You"
I have two collection types declared at the SQL level.
1. Do you know of any known bugs with the BULK COLLECT clause used
with the TABLE operator? I have a situation now where I am...
|
by: akej via SQLMonster.com |
last post by:
Hi, i have table with 15 columns
CREATE TABLE . (
PRIMARY KEY ,
NULL ,
NULL ,
NULL ,
NULL ,
(50) NULL ,
NULL
|
by: Philip Boonzaaier |
last post by:
I want to be able to generate SQL statements that will go through a list of
data, effectively row by row, enquire on the database if this exists in the
selected table- If it exists, then the colums...
|
by: Sean |
last post by:
HI There,
I am making the transition from asp to asp .net, I am currenty writing an
application that requires a bulk insert from a webform into SQL server,
normally I would just create rows of...
|
by: Tim |
last post by:
Hi
A while ago I got some help in writing a mock console. The idea was to write a VB app that contained a textbox, then run a process from within the app and redirect the stdout to the textbox. ...
|
by: sumanroyc |
last post by:
Hi,
We are trying to insert into a remote database using the forall statement 5000 rows at a time.
type t_column_id is table of number index by binary_integer;
v_column_id t_column_id;
begin...
|
by: devmiral |
last post by:
Hello every one I trying simple bulk collect , it is giving me an error in oracle 9i, i wroe as per book and on the web deatils about bulk collect
declare
type emp_type is table of emp%rowtype;...
|
by: debasisdas |
last post by:
We can fetch from a cursor into one or more collections:
DECLARE
TYPE NameList IS TABLE OF employees.last_name%TYPE;
TYPE SalList IS TABLE OF employees.salary%TYPE;
CURSOR c1 IS SELECT...
|
by: pravatjena |
last post by:
can someone explain clearly what is bulk collect and for all..........
|
by: oravm |
last post by:
Hi,
I re-write a query and used bulk collect to improve the performance of the batch process. The query below has NO compile error but when execute query there is error 'ORA-01403: no data...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
| |