SQL Accept Parameter error

Hi,

 

I am trying to get the schema name as input and pass it such as this inside the SQL script

 

accept SCHEMA_OWNER char prompt 'Enter the SCHEMA_OWNER
 alter session set current_schema=&SCHEMA_OWNER;

 

This throws an error when i run this sql script

 

C:\Liquibase_new>liquibase --driver=oracle.jdbc.OracleDriver --classpath=C:\app<br>IBM\product\11.2.0\client_3\ojdbc6.jar --changeLogFile=C:\temp\test.xml –
url=“jdbc:oracle:thin:@localhost:1521:orcl” --username=system --password=xxx1
23 update


Liquibase update Failed: Error parsing line 7 column 51 of C:/temp/test.xml: The
 entity “SCHEMA_OWNER” was referenced, but not declared.
 

How to accept the value and pass it the Schema_owner?

 

Please let me know .

 

Thanks a lot,

Muthu
 

XML thinks things in the format &LETTERS; is an escape sequence. You’ll have the escape the & like:



Thanks Nathan.
I have used the escape sequence and tried the below script.

prompt
accept SCHEMA_OWNER char prompt 'Enter the SCHEMA_OWNER for the Deployment: ’ default none
alter session set current_schema=&SCHEMA_OWNER;

I am getting the following error:


G:\liquibase>liquibase --driver=oracle.jdbc.OracleDriver --classpath=G:\app\ARUN
\product\11.2.0\dbhome_1\jdbc\lib\ojdbc6.jar --changeLogFile=F:\liquibase_script
s\run_sprint.xml --url=“jdbc:oracle:thin:@localhost:1521:orcl” --username=vidyas
hri --password=Blue1234  update
Liquibase update Failed: Migration failed for change set F:/liquibase_scripts/ru
n_sprint.xml::1_run_sprint_5_38::ARUN:
     Reason: liquibase.exception.DatabaseException: Error executing SQL spool ru
n_sprint_5_38.log
accept SCHEMA_OWNER char prompt 'Enter the SCHEMA_OWNER for the Deployment: ’ default none
alter session set current_schema=&SCHEMA_OWNER: ORA-00900: invalid SQL statement

The prompt didnt work. Can you pls help me resolve this.

Muthu

Actually, if you are trying to do oracle parameter replacement with &, that is functionality in SQL*Plus, not in JDBC that liquibase goes through.


Liquibase has similar functionality with changelog parameters: http://www.liquibase.org/documentation/changelog_parameters.html


Nathan