Connecting to different schema while executing oracle scripts via Ant -


basically ant sql task following:

  1. deletes tables present in schemaa
  2. creates table schemaa
  3. deletes tables present in schemab
  4. creates table schemab

    <target name="exexcuteoracle"> <sql driver="oracle.jdbc.driver.oracledriver" url="jdbc:oracle:thin:@hostname:1521:orcl" userid="username" password="pass" print="yes">     <classpath>         <pathelement location="${src.driversdir}/oracle/ojdbc6.jar" />     </classpath>     <transaction src="${src.sqldir}/oracle/drop_tablesschemaa.sql" />     <transaction src="${src.sqldir}/oracle/create_tablesschemaa.sql" />     <transaction src="${src.sqldir}/oracle/drop_tablesschemab.sql" />                <transaction src="${src.sqldir}/oracle/create_tablesschemab.sql" />     <transaction src="${src.sqldir}/oracle/count_table_script.sql" /> </sql> 

the problem "create_tablesschemab.sql" doesn't create tables schemab creates schemaa only. schemaa has tables. there script says connect schemaa or "connect schemaa"?

this because call not changing context 2nd schema

possible solutions be...

  1. if have thick oracle client on machine running ant script , tns-names set up, can connect inside sql script .. easier.
  2. create common task takes schema ant parameter ${}-- guess build properties -- avoid duplication main connection code-- , 2 tasks calling common task passing different schema names .. since there 2 tasks -- can use specific sql script there.

Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -