-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/  
Divya
  • 1

1 Answers1

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

Roman Spiak
  • 299
  • 1
  • 6