SQLPLUS help please [message #373759] |
Fri, 04 May 2001 17:02 |
S Bala
Messages: 9 Registered: April 2001
|
Junior Member |
|
|
Hi ,
when i do a rtrim on a field i get the following error:
===============================================
SQL> select rtrim(details) from mytable where my_field='2000USFI03378';
select rtrim(details) from mytable where my_field='2000USFI03378'
*
ERROR at line 1:
ORA-00932: inconsistent datatypes
=============================================
The datatype of this variable is unknown to me(
its from a remote database)
Basically i want to trim off the extra special characters from the field so that
i can print the variable to the web.
Can you please help me how do i retrieve
a ASCII only extract from this field?
Thanx very much ,
Bala S
|
|
|
Re: SQLPLUS help please [message #373761 is a reply to message #373759] |
Fri, 04 May 2001 17:50 |
Andrew again...
Messages: 270 Registered: July 2000
|
Senior Member |
|
|
In sqlplus to see the datatypes, enter:
descr table_name
or
descr table_name@db_link
Use trim() as the new equivalent to the combination of ltrim() and rtrim(). Use translate() or replace() to remove unwanted characters. The functions are similar but different. use chr() to specify unprintable characters.
select translate('hello'||chr(10)||'world',chr(10),'~') from dual
|
|
|
Re: SQLPLUS help please [message #373765 is a reply to message #373761] |
Mon, 07 May 2001 07:47 |
S Bala
Messages: 9 Registered: April 2001
|
Junior Member |
|
|
Hi ,
the datatype of the field details is LONG.
Thanx for your help.
But the trim(details) failed to work:
SQL> select trim(details) from mytable where my_field='2000';
select trim(details) from invoices where my_field='2000'
*
ERROR at line 1:
ORA-00904: invalid column name
======================
In case if there is anyway to remove the special characters
from the LONG datatype, can you please let me know
about the same.
Thanx ,
Bala S
|
|
|
|