0

In this code I am calling this FSG.REPLACE_STRING function which has 2 parameters, original string and special characters string. The original string is a select query from a table and special character string is 'A'.

I have written the code:

FSG.REPLACE_STRING ( (SELECT CAST(NVL(PRAD_ID            , ' ') AS CHAR(12))
FROM FSG_WRK.FSG_PRCB_AUXDB_PRAD WHERE PRAD_ID= '003204091007'), A );

but this is not working.

1
  • what do you have as the output of running script? Commented Sep 27, 2018 at 8:11

1 Answer 1

2

You are trying to pass the table column value into the function, so you need to restructure your statement:

SELECT FSG.REPLACE_STRING (CAST(NVL(PRAD_ID, ' ') AS CHAR(12)), 'A')
FROM FSG_WRK.FSG_PRCB_AUXDB_PRAD
WHERE PRAD_ID= '003204091007';

Although the NVL() part seems a bit pointless if you're filtering for a specific (not-null) value in the query. Casting to char looks suspicious too.

Sign up to request clarification or add additional context in comments.

3 Comments

I used this , but I am getting error ORA-06502: PL/SQL: numeric or value error: character string buffer too small ORA-06512: at "FSG.REPLACE_STRING", line 36 06502. 00000 - "PL/SQL: numeric or value error%s" *Cause: *Action: I am selecting 20 columns from this select query. Its an exiting code so I am not touching the select statement .
That's coming from inside your function, and we don't know what that is doing.
if you're setting the value in the join, you don't need the NVL function

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.