Question Locked

Oracle REPLACE Function - limitations? ORA-01460

0 helpful
4 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Is there a limitation to Oracle's REPLACE function? I'm trying to use it to replace a username & password in a html/text file (read in with utl_file) with a username & password provided as parameters.

But I get the following:

ORA-01460: unimplemented or unreasonable conversion requested

However, if the file read in is shorter, it works just fine.

4 replies

by marv732

so maybe you are exceeding the varchar2 limit? although I would expect a different error for that.
Have a look on asktom.oracle.com.

Greg

by v_legaspi

Looks like you're right. I see MetaLink Note:300268.1 about INSTR function and it sounds similar to my situation.

Only thing is, I don't know if the workaround of using DBMS_LOB has a REPLACE function.

Any ideas?

Here's my failing code:
select REPLACE(REPLACE (message, 'USERNAME', uname), 'PASSWORD', psswd)
into message_updated
from dual;

I'm on 10gR2 on Solaris 9.

by v_legaspi

Nevermind... I figured it out, and posting for everyone's benefit. =)

I just changed my SQL into PL/SQL:
Instead of:
select REPLACE(REPLACE (message, 'USERNAME', uname), 'PASSWORD', psswd)
into message_updated
from dual;

I changed it to:
message_updated := REPLACE(REPLACE (message, 'USERNAME', uname), 'PASSWORD', psswd);

This discussion is closed to new replies.