Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Database > Oracle
|
Oracle General Oracle database discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Oracle section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 13th, 2012, 04:42 PM
Registered User
 
Join Date: Dec 2010
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default HELP!!! : ORA-01858: non-numeric character error

When I try to run the script below, I get this error:

Enter current asof_id (MM/DD/YYYY): 6/8/2012

Table dropped.


Table created.

declare
*
ERROR at line 1:
ORA-01858: a non-numeric character was found where a numeric was expected
ORA-06512: at line 46



Commit complete.


I have spent a couple of hours trying everything possible but can't figure out what I am doing wrong.



accept asofcur prompt 'Enter current asof_id (MM/DD/YYYY): ';

drop table gwa_oet_refresh;


create table gwa_oet_refresh
(
t_general_ky NUMBER(38) ,
t_social_security_id varchar2(9),
t_recipient_last_nm VARCHAR2(100),
t_recipient_first_nm VARCHAR2(100),
t_recipient_middle_nm VARCHAR2(100),
t_servicing_cpac_id_nm VARCHAR2(100),
t_organization_first_line_tx VARCHAR2(50),
t_changed_fld VARCHAR2(30),
t_field_value_new VARCHAR2(15),
t_field_value_old VARCHAR2(15),
t_ending_dt_new DATE,
t_ending_dt_old DATE
)
/

declare

t_general_ky number(38) := null;
t_social_security_id varchar2(9) := null;
t_recipient_last_nm VARCHAR2(100) := null;
t_recipient_first_nm VARCHAR2(100) := null;
t_recipient_middle_nm VARCHAR2(100) := null;
t_servicing_cpac_id_nm VARCHAR2(100) := null;
t_organization_first_line_tx VARCHAR2(50) := null;
t_changed_fld VARCHAR2(30) := null;
t_field_value_new VARCHAR2(15) := null;
t_field_value_old VARCHAR2(15) := null;
t_ending_dt_new DATE;
t_ending_dt_old DATE ;

v_prev_payplan_cd varchar2(60) := null;
v_prev_payplan_end_date date := null;


cursor payplan
is
select a.general_ky,
a.ending_dt,
a.social_security_id,
a.recipient_last_nm,
a.recipient_first_nm,
a.recipient_middle_nm,
a.servicing_cpac_id_nm,
a.organization_first_line_tx,
a.pay_plan_cd,
a.pay_plan_cd_effective_dt
FROM general_hist a
ORDER BY general_ky;
v_payplan payplan%rowtype;


begin

open payplan;
loop
fetch payplan into v_payplan;
exit when payplan%notfound;

if payplan%found then

if to_date(v_payplan.pay_plan_cd_effective_dt)
= to_date('asofcur') then

if payplan%ROWCOUNT = 1 then
v_prev_payplan_cd := v_payplan.pay_plan_cd;
v_prev_payplan_end_date := v_payplan.ending_dt;

else
if to_date(v_prev_payplan_cd) =
to_date(v_payplan.pay_plan_cd) then
v_prev_payplan_cd := v_payplan.pay_plan_cd;
v_prev_payplan_end_date := v_payplan.ending_dt;
else
t_general_ky := v_payplan.general_ky;
t_social_security_id := v_payplan.social_security_id;
t_recipient_last_nm := v_payplan.recipient_last_nm;
t_recipient_first_nm := v_payplan.recipient_first_nm;
t_recipient_middle_nm :=
v_payplan.recipient_middle_nm;
t_servicing_cpac_id_nm :=
v_payplan.servicing_cpac_id_nm;
t_organization_first_line_tx :=
v_payplan.organization_first_line_tx;
t_changed_fld := 'Pay Plan ';
t_field_value_new := v_payplan.pay_plan_cd;
t_field_value_old := v_prev_payplan_cd;
t_ending_dt_new := v_payplan.ending_dt;
t_ending_dt_old := v_prev_payplan_end_date;
v_prev_payplan_cd :=v_payplan.pay_plan_cd;
v_prev_payplan_end_date := v_payplan.ending_dt;
end if;
end if;
end if;
end if;
end loop;
close payplan;
end;
/

commit;





Similar Threads
Thread Thread Starter Forum Replies Last Post
ORA-00911: invalid character cpajoe2001 Oracle ASP 2 August 18th, 2008 06:52 AM
character entity into numeric character entity srkumar XSLT 1 November 22nd, 2007 04:53 AM
[Oracle][ODBC][Ora][ORA-01013 Corey Access 1 December 15th, 2006 10:29 AM
Ora-01034 error [email protected] Oracle 5 September 30th, 2004 08:40 PM
Need help to Resolve Error ORA-00933 sandeepshivathaya Oracle 0 August 19th, 2004 07:15 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.