473,385 Members | 1,587 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,385 software developers and data experts.

trim(' ') problem & ORA-03113

Whenever I execute TRIM(' ')in a stored procedure or trigger, I get an
ORA-03113 error.

I have an oracle db 8.1.7.0.1 Enterprise edition installed on a
linux-Mandrake 9.1.

EXEMPLE:
I created the function IS_NULL which returns 1 or 0 if the parameter is
empty or not:

CREATE OR REPLACE FUNCTION IS_NULL(v VARCHAR2)
RETURN NUMBER
IS
BEGIN
IF TRIM(v) IS NULL THEN
RETURN 1;
ELSE
RETURN 1;
END IF;
END;
When excuting the following sql I get an ORA-03113 error

SQL> select is_null(' ') from dual;
select is_null(' ') from dual
*
ERROR at line 1:
ORA-03113: end-of-file on communication channel
What's wrong with TRIM(' ') and how else can I check if a variable
consists of empty spaces without using TRIM?

Jan Bols

Jul 19 '05 #1
4 11607
Jan Bols wrote:
Whenever I execute TRIM(' ')in a stored procedure or trigger, I get an
ORA-03113 error.

I have an oracle db 8.1.7.0.1 Enterprise edition installed on a
linux-Mandrake 9.1.

EXEMPLE:
I created the function IS_NULL which returns 1 or 0 if the parameter is
empty or not:

CREATE OR REPLACE FUNCTION IS_NULL(v VARCHAR2)
RETURN NUMBER
IS
BEGIN
IF TRIM(v) IS NULL THEN
RETURN 1;
ELSE
RETURN 1;
END IF;
END;
When excuting the following sql I get an ORA-03113 error

SQL> select is_null(' ') from dual;
select is_null(' ') from dual
*
ERROR at line 1:
ORA-03113: end-of-file on communication channel
What's wrong with TRIM(' ') and how else can I check if a variable
consists of empty spaces without using TRIM?

Jan Bols


Not really any help, but I don't think the problem is the trim-function.
Your example works fine on my database. I'm running 9.2.0.1 on Windows
though.

Michael

Jul 19 '05 #2
G M
Your code worked on my 8173 Oracle db too. Maybe your sqlplus session
had some problem. Try to open another new sqlplus session and see if
it solves your problem.

HTH.

Guang
Jan Bols <ja*@ivpv.ugent.be> wrote in message news:<bk**********@gaudi2.UGent.be>...
Whenever I execute TRIM(' ')in a stored procedure or trigger, I get an
ORA-03113 error.

I have an oracle db 8.1.7.0.1 Enterprise edition installed on a
linux-Mandrake 9.1.

EXEMPLE:
I created the function IS_NULL which returns 1 or 0 if the parameter is
empty or not:

CREATE OR REPLACE FUNCTION IS_NULL(v VARCHAR2)
RETURN NUMBER
IS
BEGIN
IF TRIM(v) IS NULL THEN
RETURN 1;
ELSE
RETURN 1;
END IF;
END;
When excuting the following sql I get an ORA-03113 error

SQL> select is_null(' ') from dual;
select is_null(' ') from dual
*
ERROR at line 1:
ORA-03113: end-of-file on communication channel
What's wrong with TRIM(' ') and how else can I check if a variable
consists of empty spaces without using TRIM?

Jan Bols

Jul 19 '05 #3
firtsly, I assume one of those is a "return 0;"

Secondly, you probably need a PRAGMA inside the function definition
(not always needed in 9+ DBs). From memory it is RNDS, WNDS, RNPS
WNPS.

ETA

Jan Bols <ja*@ivpv.ugent.be> wrote in message news:<bk**********@gaudi2.UGent.be>...
Whenever I execute TRIM(' ')in a stored procedure or trigger, I get an
ORA-03113 error.

I have an oracle db 8.1.7.0.1 Enterprise edition installed on a
linux-Mandrake 9.1.

EXEMPLE:
I created the function IS_NULL which returns 1 or 0 if the parameter is
empty or not:

CREATE OR REPLACE FUNCTION IS_NULL(v VARCHAR2)
RETURN NUMBER
IS
BEGIN
IF TRIM(v) IS NULL THEN
RETURN 1;
ELSE
RETURN 1;
END IF;
END;
When excuting the following sql I get an ORA-03113 error

SQL> select is_null(' ') from dual;
select is_null(' ') from dual
*
ERROR at line 1:
ORA-03113: end-of-file on communication channel
What's wrong with TRIM(' ') and how else can I check if a variable
consists of empty spaces without using TRIM?

Jan Bols

Jul 19 '05 #4
Jan Bols <ja*@ivpv.ugent.be> wrote in message news:<bk**********@gaudi2.UGent.be>...
Whenever I execute TRIM(' ')in a stored procedure or trigger, I get an
ORA-03113 error.


I've just run into the same bug - on an 8.1.6.3.0 database. It'll let
you

SELECT TRIM(' ') FROM dual;

but crashes out if you

DECLARE
x VARCHAR2(10);
BEGIN
x := TRIM(x);
END;

Fortunately there's an easy workaround, you just go back to how we
used to do it before TRIM() was invented...

x := LTRIM(RTRIM(x));

That seems to work without any problems.

-- Chris Hunt
http://www.extracon.com
Jul 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Paul | last post by:
Hi, Using the code below I can extract the filename from a path but I would like to know how to get just the path too. So if the full path is "C:\A Long Time Ago\In A Galaxy\Far Far...
12
by: Robert Mark Bram | last post by:
Hi All, I am using the following trim function: function trim (str) { return str.replace(/^\s*/g, '').replace(/\s*$/g, ''); } The problem is that this doesn't trim instances of the...
1
by: dirk van waes | last post by:
Hello everyone, Being complete newbie in asp.net I am trying to make an example which works with a very simple database. First I made my project in VS- vb.net, draging an oledbconnection and an...
3
by: yawnmoth | last post by:
<? echo 'a'.trim(html_entity_decode('&nbsp;a&nbsp;')).'a'; ?> Shouldn't PHP output aaa? Looking at the documentation for trim I see that it doesn't support chr(0xA0) (eg....
1
by: helraizer1 | last post by:
Hi all, I have a dynamic image that picks out data from a dynamically created .line file. showimage.php(5) <?php include("linesfile.php5"); $linesDataFile = new DataFile("data.line");
4
by: Jan Bols | last post by:
Whenever I execute TRIM(' ')in a stored procedure or trigger, I get an ORA-03113 error. I have an oracle db 8.1.7.0.1 Enterprise edition installed on a linux-Mandrake 9.1. EXEMPLE: I...
0
by: praveenhathwar | last post by:
Hi, I have a flexgrid with few data. Now I want that to be print in DOS Mode (To be print on Notepad), Preview it for the user and prevent the user from modifying the data in it. Is there any...
7
by: kimmelsd33 | last post by:
I am using VB6. I want to read a tab delimited file, and assign each column value into a variable. If the variable is "-999.25", I want to make it a "0". I then want to reassemble the values, and...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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.