Oracle FAQ Your Portal to the Oracle Knowledge Grid

Home -> Community -> Mailing Lists -> Oracle-L -> RE: stored procedure errors

RE: stored procedure errors

From: Koivu, Lisa <>
Date: Thu, 09 Aug 2001 14:21:32 -0700
Message-ID: <>

Your dynamic statement is missing a paren somewhere, that's why it compiles without error.  Dig through your statement, you'll find where the paren is missing (it'll be within your quotes

Lisa Koivu
Headache Queen and DBA
Ft. Lauderdale, FL, USA

-----Original Message-----

From:   Ranganath K []
Sent:   Thursday, August 09, 2001 12:55 PM
To:     Multiple recipients of list ORACLE-L
Subject:        stored procedure errors

Hi Gurus,

I am creating a stored procedure using the below code.  The procedure gets created successfully.  But while executing the procedure I am getting below errors:
ERROR at line 1:

ORA-00907: missing right parenthesis
ORA-06512: at line 1

CREATE OR REPLACE procedure create_ratedOutput(tablename IN varchar2) authid current_user
EXECUTE IMMEDIATE 'create table '|| tablename ||'( version char(1) not null,

ne_id number(5) not null,
ne_sequence number(9) not null,
ne_date date not null,

device_id_indictor char(1) not null,
device_id varchar2(40) not null,
service_type_1_rule char(1) not null,
raw_service_type1_id varchar2(20) not null, override1_id varchar2(20),
service_type_2_rule char(1) not null,
raw_service_type2_id varchar2(20),
override2_id varchar2(20),
call_date date not null,
call_completion number(3) not null,
call_termination number(3) not null,
call_direction char(1) not null,

mobile_to_mobile_indicator char(1) not null, electronic_serial_number varchar2(11),
initial_cell_site varchar2(10),
second_number varchar2(20) not null,
dest_address varchar2(64),
special_cases varchar2(5) not null,
call_start_time_1 date not null,
call_duration_1 number(6) not null,
call_start_time_2 date,
call_duration_2 number(6),
home_zone duration number(6),
roaming_indicator char(1) not null,
roaming_direction char(1),
service_provider number(9),

service_provider_batch number(9),
service_provider_location varchar2(12),
ip_address varchar2(15),
data_size number(9),
user_defined1 varchar2(40),
user_defined2 varchar2(40),
user_defined3 varchar2(40),
user_defined4 varchar2(40),
user_defined5 varchar2(40),
user_defined6 varchar2(40),
user_defined7 varchar2(40),
user_defined8 varchar2(40),

us_call_type number(2),
day_type number(2),

origin_city varchar2(15),
origin_state char(2),
origin_country_abbr char(4),
destination_city varchar2(15),
destination_state char(2),
destination_country_abbr char(4),
destination_lata char(4),
destination_ocn char(4),

destination_rocn char(4),
destination_ioc_boc char(1),
distance_dialed number(9),
billed_duration number(6),
rate_periods_used number(1),
rate_period_description varchar2(30),
st1_rate_period_1 number(2),
st1_billed_duration_1 number(6),
st1_charge_1 number(18, 4),
st1_rate_period_id_2 number(2),
st1_billed_duration_2 number(6),
st1_charge_2 number(18, 4),
st1_billed_duration_rest number(6),
st1_charge_rest number(18, 4),
st2_rate_period_1 number(2),
st2_billed_duration_1 number(6),
st2_charge_1 number(18, 4),
st2_rate_period_id_2 number(2),
st2_billed_duration_2 number(6),
st2_charge_2 number(18, 4),
st2_billed_duration_rest number(6),
st2_charge_rest number(18, 4),

state_taxes number(18, 4),
local_taxes number(18, 4),

status char(1),
status_date date,
billed_id varchar2(20) not null,
customer char(6) not null,
billed_start_date date not null,
duplicate_key_sequence char(1) not null, company char(3),
actual_service_type1 varchar2(20),
actual_service_type2 varchar2(20),
customer_cycle number(2),
usage_file_end_day number(2),

sort_method char(1),
rate_plan varchar2(20),
rate_plan_effective_date date,
revenue_code_by_plan char(4),
revenue_code_by_service1 char(4),
revenue_code_by_service2 char(4),
billing_item char(4),
billing_seq char(2),

billing_po char(2),
billing_cancel_date date,
free_usage_method char(1),
volume_discount_method char(1),
invoice_summary1 char(1),
invoice_summary2 char(1),
free_usage_amount1 number(18, 4),
free_usage_amount2 number(18, 4),
free_usage_details varchar2(40),
vol_disc_amount_applied1 number(18, 4),

vol_disc_amount_applied2 number(18, 4),
vol_disc_details varchar2(40),
carrier1 varchar2(20),
action_type1 char(1),
carrier2 varchar2(20),
action_type2 char(1),
actual_st1_charge_total number(18, 4),

actual_st2_charge_total number(18, 4),
alternate_amounts_calculated char(1),
alternate_amount_1 number(18, 4),
alternate_amount_2 number(18, 4),

PRIMARY KEY (billed_id, customer, billed_start_date, duplicate_key_sequence))';
execute immediate 'insert into outputstatus values('||chr(39)||tablename||chr(39)||','||chr(39)||1||chr(39)||')'; commit;

Can anyone help me in this regard?



DISCLAIMER: This correspondence is confidential and intended for the named recipient(s) only. If you are not the named recipient and receive this correspondence in error, you must not copy, distribute or take any action in reliance on it and you should delete it from your system and notify the sender immediately. Unless otherwise stated, any views or opinions expressed are solely those of the author and do not represent those of Subex Systems Limited.


Please see the official ORACLE-L FAQ:

Author: Ranganath K

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
To REMOVE yourself from this mailing list, send an E-Mail message to: (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from).  You may also send the HELP command for other information (like subscribing). Received on Thu Aug 09 2001 - 16:21:32 CDT

Original text of this message