Priyanka Kaushik
Priyanka Kaushik

Reputation: 153

Replace function query

One column of my query output contains char 13 ( new line character). To replace it with nothing I am trying to use below function but it is giving me below error ORA-00936: missing expression

select
replace(AUDITOR_COMMENTS,char(13),'')  
from csa_sli_all.T_CONV_QUOTE 

When I put char(13) in quote 'char(13)' error goes but it will not do as desired. I think I cannot include char(13) in quotes . I am using Oracle Database 10g Release 10.2.0.1.0 - 64bit Production

Upvotes: 1

Views: 3967

Answers (4)

shareef
shareef

Reputation: 9581

replace(your_data, chr(13), '')

try this as @sebastian said

select
replace(AUDITOR_COMMENTS,chr(13),'')  
from csa_sli_all.T_CONV_QUOTE 

Upvotes: 1

Jeevi
Jeevi

Reputation: 3042

Try this :

REPLACE(col_name, CHR(13) + CHR(10), '')

or

REPLACE(REPLACE( col_name, CHR(10) ), CHR(13) )

Upvotes: 1

Satya
Satya

Reputation: 8881

try chr(13) instead of char(13) and see if it works

Upvotes: 1

sebastian
sebastian

Reputation: 2507

The function isn't char it's chr try calling:

select
replace(AUDITOR_COMMENTS,chr(13),'')  
from csa_sli_all.T_CONV_QUOTE 

Upvotes: 6

Related Questions