-1

I am trying to pass mount_point details in my oracle script.

I am able to pass integer variable using below code but not able to send mount point details in oracle script:

sed "s/@@pqr@@/$space/g" tablespace_extend.sql |
sqlplus -s "/ as sysdba"
                                                             
BEGIN
space:="@@pqr@@";
dbms_output.put_line(space);
END;
/

When I am using same code to pass mount point details, it is not working. it returns this error message:

sed: -e expression #1, char 13: unknown option to `s', mount_point = /u08/dbname/  
2

1 Answer 1

1

try the following as I assume your variable contains special character / used as delimiter which is breaking the sed command:

$ space="/u08/dbname/"
$ sed "s:@@pqr@@:$space:g" tablespace_extend.sql
BEGIN
space:="/u08/dbname/";
dbms_output.put_line(space);
END;

I just switched the sed delimiter to : character.

more on this here: https://stackoverflow.com/questions/16790793/how-to-insert-strings-containing-slashes-with-sed

2
  • Hi Roman, Its working! Thanks Commented Oct 30, 2020 at 6:17
  • good to be of help :) Commented Nov 1, 2020 at 0:26

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.