Skip to Main Content

ODP.NET

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ORA-1858: a non-numeric character was found where a numeric was expected

621554Feb 5 2008 — edited Feb 8 2008
Hi, I have the Function below to do an insert or update depending on situation but I get an exception each time I run my code can anyone please help me find the error in this??



FUNCTION exceptionlog_insert_update_fn (
v_currentmethod IN VARCHAR,
v_customerrormessage IN VARCHAR,
d_datelogged IN DATE,
v_helplink IN VARCHAR,
v_http_costcenter IN VARCHAR,
v_http_email IN VARCHAR,
v_http_host IN VARCHAR,
v_http_sm_authentic IN VARCHAR,
v_http_sm_authorized IN VARCHAR,
v_http_sm_sdomain IN VARCHAR,
v_http_standardid IN VARCHAR,
v_http_user_agent IN VARCHAR,
v_innerexception IN VARCHAR,
n_logstatus IN NUMBER,
v_exceptionmessage IN VARCHAR,
v_pagepath IN VARCHAR,
v_referrer IN VARCHAR,
v_exceptionsource IN VARCHAR,
v_stacktrace IN VARCHAR,
v_squery IN VARCHAR
)
RETURN NUMBER
IS
existingexceptionlog NUMBER;
n_rowcount NUMBER;
BEGIN
SELECT exceptionlogid
INTO existingexceptionlog
FROM admin_exceptionlog
WHERE pagepath = v_pagepath
AND exceptionmessage = v_exceptionmessage
AND referrer = v_referrer
AND customerrormessage = v_customerrormessage;

IF existingexceptionlog > 0
THEN
UPDATE admin_exceptionlog
SET occurrences = 1
--datelastmodified = SYSDATE
WHERE exceptionlogid = existingexceptionlog;

n_rowcount := SQL%ROWCOUNT;

IF n_rowcount > 0
THEN
-- An Update occured RETURN O indicating this
--
RETURN 0;
END IF;
ELSE
----- If It does not already exist in the DB, Do an INSERT
-- RETRIEVE THE ID INFORMATION FIRST
INSERT INTO admin_exceptionlog
(exceptionlogid, currentmethod,
customerrormessage, datelogged, helplink,
http_costcenter, http_email, http_host,
http_sm_authentic, http_sm_authorized,
http_sm_sdomain, http_standardid,
http_user_agent, innerexception, logstatus,
exceptionmessage, pagepath, referrer,
exceptionsource, stacktrace, squery, occurrences,
datelastmodified
)
VALUES (admin_exceptionlogid_seq.NEXTVAL, v_currentmethod,
v_customerrormessage, d_datelogged, v_helplink,
v_http_costcenter, v_http_email, v_http_host,
v_http_sm_authentic, v_http_sm_authorized,
v_http_sm_sdomain, v_http_standardid,
v_http_user_agent, v_innerexception, n_logstatus,
v_exceptionmessage, v_pagepath, v_referrer,
v_exceptionsource, v_stacktrace, v_squery, 1,
SYSDATE
);

n_rowcount := SQL%ROWCOUNT;
IF n_rowcount > 0
THEN
-- An Update occured RETURN O indicating this
--
RETURN 0;
END IF;
END IF;
EXCEPTION
WHEN OTHERS
THEN
RETURN 1;
END exceptionlog_insert_update_fn;
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 7 2008
Added on Feb 5 2008
17 comments
17,721 views