samedi 27 juin 2015

How can I pass arguments to a PL/SQL procedure, while invoking it from ant sql task?

I have an ant target like-

<target name="run-patched-sql-file">
    <path id="antclasspath">
        <fileset dir="${weblogic.server.dir}/server/lib">
            <include name="*ojdbc6.jar"/>
        </fileset>
    </path>
    <property name="pathvar" refid="antclasspath"/>
    <filelist id="sql-files" dir="../../db/scripts/oracle/">
            <file name="scripts/scriptToExecute.sql"/>
    </filelist>
    <sql driver="${operationsDB.driver}" url="jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=${operationsDB.host}) (PORT=${operationsDB.port}))(CONNECT_DATA=(SERVICE_NAME=${operationsDB.serviceName})))" userid="${operationsDB.user}" password="${OIM.DBPassword}" delimiter="/" delimitertype="row" keepformat="yes" onerror="continue" caching="true" escapeprocessing="no" classpathref="antclasspath">
        <path>
            <filelist refid="sql-files"/>
        </path>
    </sql>
</target>

Now scriptToExecute.sql expects an argument. How can we pass this argument to sql script from ant task.

Aucun commentaire:

Enregistrer un commentaire