473,386 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

errors PLS-00302: component 'CALLS' must be declared How to solve this

Expand|Select|Wrap|Line Numbers
  1. CREATE OR REPLACE PROCEDURE CRIMES.E_PROC
  2.  IS
  3.  v_MOB_COUNTER          NUMBER(10) :=0;
  4.  v_imsi_counter         NUMBER(16) :=0;
  5.  v_imei_counter         NUMBER(16) :=0;
  6.  v_his_counter          NUMBER(16) :=0;
  7.  v_tower_counter        NUMBER(16) :=0;
  8.  v_exists               NUMBER(16) :=0;        /* should we check for duplicate record for each entry */
  9. -- v_cust_id              NUMBER(10) :=0;
  10.  v_CALLTIME             date;
  11. -- v_CALTYPE              VARCHAR2(4);
  12.  v_CALLDT               CRIMES.CALLS.call_date%TYPE;
  13.  v_CALLTYPE             VARCHAR2(4);
  14.  v_CUST_COUNTER         NUMBER(10) :=0;
  15.  v_MYNUMBER             CRIMES.CALLS.mobile_no%TYPE;
  16.  v_HIS_NUMBER           CRIMES.CALLS.HIS_NUMBER%TYPE;
  17.  v_SIMID                CRIMES.CALLS.IMSI_NO%TYPE;
  18.  v_PHONEID              CRIMES.CALLS.IMEI_NO%TYPE;
  19.  v_TOWERID              CRIMES.CALLS.START_TOWER_ID%TYPE;
  20.  v_END_BTS_ID           CRIMES.CALLS.END_TOWER_ID%TYPE;
  21.  v_DURATION             CRIMES.CALLS.DURATION%TYPE;
  22.  v_HIS_IMEI             CRIMES.CALLS.HIS_IMEI_NO%TYPE;
  23.  v_HIS_IMSI             CRIMES.CALLS.HIS_IMSI_NO%TYPE;
  24.  v_HIS_START_BTS_ID     CRIMES.CALLS.HIS_START_BTS_ID%TYPE;
  25.  v_HIS_END_BTS_ID       CRIMES.CALLS.HIS_END_BTS_ID%TYPE;
  26.  v_ORIGINATING_NO       CRIMES.CALLS_DUMMY.ORIGINATING_NO%TYPE;
  27.  v_SMSC                 CRIMES.CALLS.SMSC%TYPE;
  28.  v_Roam_Nw              CRIMES.CALLS.Roam_Nw%TYPE;
  29.  
  30.  v_mis_match_format     EXCEPTION;
  31.  CURSOR c1 IS SELECT  MOBILE_NO, HIS_NUMBER, IMSI_NO, IMEI_NO, CALL_DATE, CALL_TYPE,
  32.                      START_TOWER_ID, END_TOWER_ID, DURATION,
  33.                      HIS_IMEI_NO, HIS_IMSI_NO, HIS_START_BTS_ID, HIS_END_BTS_ID, ORIGINATING_NO,SMSC,Roam_Nw
  34.                      FROM CRIMES.calls_dummy;
  35. --                     where rownum <= 10000 ;
  36.  
  37.  BEGIN
  38.    -- Current Customer Id
  39.    SELECT NVL(MAX(customer_id),0) INTO v_CUST_COUNTER FROM CRIMES.CUSTOMER ;
  40.    IF v_CUST_COUNTER = 0 THEN
  41.       v_CUST_COUNTER := 1;
  42.    ELSE
  43.       v_CUST_COUNTER :=  v_CUST_COUNTER + 1;
  44.    END IF;
  45.    OPEN c1;
  46.    LOOP
  47.    FETCH c1 INTO v_MYNUMBER, v_HIS_NUMBER, v_SIMID, v_PHONEID, v_CALLTIME,
  48.                  v_CALLTYPE, v_TOWERID, v_END_BTS_ID, v_DURATION, v_HIS_IMEI,
  49.                  v_HIS_IMSI, v_HIS_START_BTS_ID, v_HIS_END_BTS_ID, v_ORIGINATING_NO, v_SMSC, v_Roam_Nw;
  50.    EXIT WHEN c1%NOTFOUND;
  51.  
  52.    IF( SUBSTR(v_MYNUMBER,1,2) ='91') THEN
  53.          v_MYNUMBER := TO_NUMBER(TO_CHAR(SUBSTR(v_MYNUMBER,3)));
  54.    END IF;
  55.    IF( SUBSTR(v_HIS_NUMBER,1,2) ='91') THEN
  56.          v_HIS_NUMBER := TO_NUMBER(TO_CHAR(SUBSTR(v_HIS_NUMBER,3)));
  57.    END IF;
  58.    -- for Mobile and Customer Tables
  59.    SELECT COUNT(*) INTO v_MOB_COUNTER FROM CRIMES.MOBILE WHERE mobile_no = v_MYNUMBER;
  60.    IF v_MOB_COUNTER = 0 THEN
  61.       INSERT INTO CRIMES.CUSTOMER (customer_id) VALUES(v_CUST_COUNTER);
  62.       INSERT INTO CRIMES.MOBILE
  63.              VALUES(v_MYNUMBER, v_CUST_COUNTER,NULL,NULL);
  64.    END IF;
  65.    -- for IMSI and Mobile Table
  66.    SELECT COUNT(*) INTO v_imsi_counter FROM CRIMES.IMSI WHERE imsi_no = v_SIMID;
  67.    IF v_imsi_counter = 0 THEN
  68.       INSERT INTO CRIMES.IMSI VALUES(v_MYNUMBER, v_SIMID, NULL);
  69.    END IF;
  70.    -- for IMEI and Mobile Table
  71.    SELECT COUNT(*) INTO v_imei_counter FROM CRIMES.IMEI WHERE imei_no = v_PHONEID;
  72.    IF v_imei_counter = 0 THEN
  73.       INSERT INTO CRIMES.IMEI VALUES(v_MYNUMBER, v_PHONEID, NULL);
  74.    END IF;
  75.    -- for HIS Number and Mobile Table
  76.    SELECT COUNT(*) INTO v_his_counter FROM CRIMES.HIS_NUMBER WHERE HIS_NUMBER = v_HIS_NUMBER;
  77.    IF v_his_counter = 0 THEN
  78.       INSERT INTO CRIMES.HIS_NUMBER VALUES(v_HIS_NUMBER, v_MYNUMBER);
  79.    END IF;
  80.    -- for Tower
  81.    SELECT COUNT(*) INTO v_tower_counter FROM TOWER WHERE tower_id = v_TOWERID;
  82.    IF v_tower_counter = 0 THEN
  83.       INSERT INTO TOWER(tower_id) VALUES(v_TOWERID);
  84.    END IF;
  85.    SELECT COUNT(*) INTO v_tower_counter FROM TOWER WHERE tower_id = v_END_BTS_ID;
  86.    IF v_tower_counter = 0 THEN
  87.       INSERT INTO TOWER(tower_id) VALUES(v_END_BTS_ID);
  88.    END IF;
  89. /*
  90.    --IF ((v_v_CALLDT IS NULL) || (v_CALLDT = '00/00/00')) THEN
  91.    IF ((v_CALLTIME IS NULL) OR (v_CALLTIME = '00/00/00')) THEN
  92.         RAISE v_mis_match_format;
  93.    END IF;
  94.  
  95.    v_CALLDT :=  TO_DATE(TO_CHAR(v_CALLTIME),'DD-MM-YY HH24:MI:SS');
  96.    if v_CALLTYPE = '1' then
  97.        v_CALLTYPE := 'MTC';
  98.    end if;
  99.    if v_CALLTYPE = '2' then
  100.        v_CALLTYPE := 'MOC';
  101.    end if;
  102.    if v_CALLTYPE = '3' then
  103.         v_CALLTYPE := 'FORW';
  104.    end if;
  105.    if v_CALLTYPE = '4' then
  106.        v_CALLTYPE := 'ROAM';
  107.    end if;
  108.    if v_CALLTYPE = '8' then
  109.        v_CALLTYPE := 'SMMO';
  110.    end if;
  111.    if v_CALLTYPE = '9' then
  112.       v_CALLTYPE := 'SMMT';
  113.    end if;
  114. */
  115.    -- for Calls Table
  116.    INSERT INTO CRIMES.abc
  117.           VALUES(v_MYNUMBER, v_HIS_NUMBER, v_SIMID, v_PHONEID, v_CALLTIME,v_CALLTYPE,
  118.                  v_TOWERID,v_END_BTS_ID,v_DURATION,v_HIS_IMEI,v_HIS_IMSI,v_HIS_START_BTS_ID,v_HIS_END_BTS_ID,v_SMSC,v_Roam_Nw);
  119.  
  120.    IF v_CALLTYPE = 'FORW' THEN
  121.       INSERT INTO crimes.ORIGINATE VALUES (v_CALLDT, v_MYNUMBER, v_ORIGINATING_NO);
  122.    END IF;
  123.  
  124.    v_CUST_COUNTER := v_CUST_COUNTER + 1;
  125.    END LOOP;
  126.    COMMIT;
  127. --   delete from CRIMES.ABC where rownum <= 10000;
  128.    CLOSE c1;
  129.    EXCEPTION
  130.    WHEN v_mis_match_format
  131.         THEN Dbms_Output.PUT_LINE('Mis Match Format');
  132. END E_PROC;
  133. /
Nov 25 '10 #1
1 4621
the CALLS component must be a table ? If you are using all the columns of the table to define datatypes of the variables why dont you create a record type of that table. like
Expand|Select|Wrap|Line Numbers
  1. v_calls_rec CRIMES.CALLS%rowtype;
  2. and refer variables like
  3. v_calls_rec.my_number or whatever be the column names
  4.  
But first you have to make sure if CALLS is a valid database object
Nov 29 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: g | last post by:
I trying to do something like below but the only problem is if I place the "&" sign i'll have errors. can anyone tell me is there any way to add the "&" sign without errors? <?xml version="1.0"...
1
by: manish | last post by:
Hi, I am a fresher in the programming field i.e although I have done programming at the basic level but at professional level I am very new and I am facing many problems. These probllems are...
4
by: eight02645999 | last post by:
hi i defined a func db = Sybase.connect(DSN) .... .... def x_dml(SQL,conn): ''' Connects to database specified, exec the SQL and returns value''' try: c = conn.cursor()
5
by: Frances | last post by:
when I check my stylesheet in W3C checker get these errors: Line: 7 Context : ?? Parse Error - .info { width: 300; height: 160; overflow: auto; } Line: 9 Context : ?? Parse error -...
3
by: bangaw | last post by:
i'm currently using c++ on windowsXP, unistd.h doesnt work for windows what other substitute for it could i use to replace it Pls. Help me Pls pls the code goes as follows #include <stdio.h>...
1
by: Vbbeginner07 | last post by:
Multiple-step OLEDB operation generated errors.Check each OLE DB status value,if available.No work was done what i ahve to check? And the code is (VB) rs.Open "select distinct...
1
by: milindras | last post by:
Hi, I have ftp client doen by using C program, when I complie its comin with a warning: data definition has no type or storage class & when i run it it comes as Segmentation fault Pls...
9
by: beet | last post by:
Hi, I am really not good at c/c++. Some simple code.. #include <stdio.h> #include <stdlib.h> #include <math.h> #include "simlibdefs.h"
2
by: jamesuzo | last post by:
Sir, I'm having problem connecting my database. I'm using Macromedia Dreamweaver 8 with Appserv 4. I have already created the table in the database. But trying to make connection in the...
8
by: Shalini Bhalla | last post by:
i have a csv file in folloeing format book_nam , author , publisher abcd , zyz , hij i want this csv file to put in data base in following format Id_no , book_id ,...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
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
0
BarryA
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...
1
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...
0
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...
0
jinu1996
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 using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.