Rep-1401: '' Fatal PL/sql error, issue with Clob and varchar2 in Oracle 11.2.0.4.0 [message #624130] |
Thu, 18 September 2014 02:39 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](http://www.gravatar.com/avatar/0e55f754c326a3348162fe92e24e9eee?s=64&d=mm&r=g) |
abhisheknarolia
Messages: 3 Registered: September 2014 Location: Pune
|
Junior Member |
|
|
Hello Experts,
I have following function created in RDF file of oracle reports 10g, and I have executed report having this function with oracle 11.2.0.3.0 and it works fine.
But when I try to execute report after oracle version upgrade from 11.2.0.3.0 to 11.2.0.4.0 with same data, report fails with runtime error Rep-1401: '' Fatal PL/sql error.
Kindly note when I run this funtion from sql developer on Oracle 11.2.0.4.0, that works fine.
With Oracle 11.2.0.4.0 version, if I typecast Text column from clob to varchar and execute report then it works... but report runs on old version (i.e. 11.2.0.3.0) without any explicit typecasting.
Is there any known issue with the Oracle 11.2.0.4.0 ? Or oracle removed implicit conversion ? But same function is working fine without type conversion in SQL Developer. Why this is only Oracle report specific ?
I will appreciate your expert comments, thanks in advance..
Note:- Text column from table msgnotes is of datatype CLOB.
CREATE OR REPLACE FUNCTION clobblobtest (TMP_MID VARCHAR2)
RETURN VARCHAR
IS
missed_text VARCHAR2 (1000) := '';
v_time_stamp DATE;
v_end_time DATE;
CURSOR c1 (c_time_stamp IN DATE, c_mid IN VARCHAR2)
IS
SELECT mn.TEXT
FROM msgnotes mn
WHERE mn.mid = c_mid AND mn.create_date >= c_time_stamp;
CURSOR c2 (
c_time_stamp IN DATE,
c_mid IN VARCHAR2,
c_end_time IN DATE)
IS
SELECT mn.TEXT
FROM msgnotes mn
WHERE mn.mid = c_mid
AND mn.create_date >= c_time_stamp
AND mn.create_date <= c_end_time;
BEGIN
IF ('1' = 'INWARD RETURN')
THEN
SELECT bbi
INTO missed_text
FROM mtf1000
WHERE mid = TMP_mid;
ELSIF '1' = 'QPH Missed'
THEN
SELECT MAX (nj.update_date)
INTO v_time_stamp
FROM newjournal nj
WHERE nj.mid = TMP_mid AND nj.status = 'CTOVRQ';
FOR i IN c1 (v_time_stamp, TMP_mid)
LOOP
missed_text := missed_text || ' ' || i.text;
END LOOP;
ELSIF ('Rejected' = 'Rejected' OR 'REJECTED' = 'REJECTED')
THEN
IF ('TERMINATED' IN ('TERMINATED'))
THEN
SELECT MIN (nj.update_date), MAX (nj.ENDDATE)
INTO v_time_stamp, v_end_time
FROM newjournal nj
WHERE nj.mid = TMP_mid
AND nj.actionid2 = '16'
AND nj.actionid1 IS NULL;
FOR i IN c2 (v_time_stamp, TMP_mid, v_end_time)
LOOP
missed_text := missed_text || ' ' || i.text;
END LOOP;
ELSE
SELECT MAX (nj.update_date)
INTO v_time_stamp
FROM newjournal nj
WHERE nj.mid = TMP_mid AND nj.status = 'UNSETLED';
FOR i IN c1 (v_time_stamp, TMP_mid)
LOOP
missed_text := missed_text || ' ' || i.text;
END LOOP;
END IF;
ELSE
missed_text := NULL;
END IF;
RETURN (missed_text);
END;
Regards,
Abhishek
[LF reformatted code & applied [code] tags]
[Updated on: Thu, 18 September 2014 23:58] by Moderator Report message to a moderator
|
|
|
|
|
Re: Rep-1401: '' Fatal PL/sql error, issue with Clob and varchar2 in Oracle 11.2.0.4.0 [message #624206 is a reply to message #624140] |
Fri, 19 September 2014 00:04 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](http://www.orafaq.com/forum/images/custom_avatars/72104.gif) |
Littlefoot
Messages: 21818 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
Why will it not help? I don't quite understand what is so specific in your case that a function wouldn't do its job if it is not part of the report, but a stored function.
Just being curious: is this a real function you use, or did you adjust it for testing purposes? I hope it is the latter, because none of its code will ever be executed, except for SELECT MIN (nj.update_date), MAX (nj.ENDDATE)
INTO v_time_stamp, v_end_time
FROM newjournal nj
WHERE nj.mid = TMP_mid
AND nj.actionid2 = '16'
AND nj.actionid1 IS NULL;
FOR i IN c2 (v_time_stamp, TMP_mid, v_end_time)
LOOP
missed_text := missed_text || ' ' || i.text;
END LOOP; which means that you can remove the rest as it won't do any harm.
|
|
|
|
|