您好 我有一个Oracle包,我必须传递不同的文件名 - a.rdt,b.rdt等
快速/快速@ rdev
接下来,我必须使用SQL任务从ANT执行oracle包,并将不同的文件作为参数传递。
我在下面的SQL Ant taks中执行执行包命令时面临错误。 请建议帮助。 感谢。
=====
<echo> Executing Package COM_READING_FROM_FILE_PKG to upload data from RDT files to Tables... </echo>
<mkdir dir="log"/>
<sql
driver="oracle.jdbc.driver.OracleDriver"
url="jdbc:oracle:thin:@172.16.88.68:1521:rdev"
userid="rapid"
password="rapid"
print="yes"
classpathref="antclasspath">
execute COM_READING_FROM_FILE_PKG.COM_READ_DATA_TO_TABLE_PRC('${path}',${file},chr(8),null);
</sql>
答案 0 :(得分:0)
<!-- Generate an sql file with tags -->
<!-- declare begin COM_READ_DATA_TO_TABLE(@DIR_NAME@, @FILE_NAME@, @SEPTTEXT@, NULL); end; -->
<!-- replace @DIR_NAME@ with dir_name, @FILE_NAME with file -->
<for param="execfile" delimiter="${line.separator}" >
<path>
<fileset dir="data" includes="*.rdt"/>
</path>
<sequential>
<propertyregex property="file"
input="@{execfile}"
regexp=".*\\(.*)" select="\1"
override="yes"/>
<echo> ${file} </echo>
<!-- Generate an sql file with tags -->
<!-- declare begin COM_READ_DATA_TO_TABLE(@DIR_NAME@, @FILE_NAME@, @SEPTTEXT@, NULL); end; -->
<!-- replace @DIR_NAME@ with dir_name, @FILE_NAME with file -->
<concat destfile="sql/EXEC_RDT.sql">
Declare Begin
COM_READING_FROM_FILE_PKG.COM_READ_DATA_TO_TABLE_PRC('DATA','${file}',chr(8),null);
End;
/
</concat>
<exec executable="sqlplus" output="./log/dept.log">
<arg line="rapid/rapid@rdev @sql/EXEC_RDT.sql"/>
</exec>
</sequential>
</for>