"D : \ ApEx_Schema \ Functions \ new.sql @@ \ main \ ONEVIEW_Integration \ 3"문자열이 있다고 말하십시오. diff 변수에 다음을 반입해야합니다. - 파일 ================문자열에서 단어를 선택하는 개미 작업
은 Pls는 어떤 ANT 작업
를 사용하는 데 도움이 (문자열의 마지막 문자 인) 및 버전 - 파일 경로 을 - 이름 ======================== 아래와 같은 데이터가 포함 된 txt 파일을 읽으려고합니다. -.\ApEx_Schema\Functions\[email protected]@\main\ONEVIEW_Integration\3
.\ApEx_Schema\Functions\[email protected]@\main\ONEVIEW_Integration\3
.\ApEx_Schema\Indexes\[email protected]@\main\ONEVIEW_Integration\2
그리고 파일 이름, 경로 세부 정보 및 버전을 수집하고 SQL 작업을 사용하여 DB에서이를 업데이트하려고합니다. 내 build.xml이 원하는대로 출력을 제공하지 않지만. 제안 및 의견 !!!
내 Build.xml 파일은 다음과 같습니다. - ============== 시작 ==================== =====
<description>
obiee copy files build file
</description>
<replace file="D:\buildFRIDAY\database.txt" token=".\" value="D:\"/>
<loadfile property="src" srcFile="D:\buildFRIDAY\database.txt"/>
<path id="antclasspath">
<fileset dir="D:\OraHome_1\oracledi\drivers">
<include name="ojdbc14.jar"/>
</fileset>
</path>
<for list="${src}" param="detls" delimiter="${line.separator}">
<sequential>
<taskdef resource="net/sf/antcontrib/antcontrib.properties"/>
<propertyregex property="path" input="@{detls}"
regexp="(.*)\\.*@@" select="\1" />
<propertyregex property="file" input="@{detls}"
regexp=".*\\(.*)@@" select="\1" />
<propertyregex property="version" input="@{detls}"
regexp=".*\\(.*)" select="\1" />
<echo>
Input: @{detls}
Path: ${path}
File: ${file}
Version: ${version}
</echo>
<if>
<matches string="@{detls}" pattern=".sql" />
<then>
</then>
</if>
<if>
<matches string="@{detls}" pattern="[0-9]" />
<then>
<sql
driver="oracle.jdbc.driver.OracleDriver"
url="jdbc:oracle:thin:@172.16.88.68:1521:rdev"
userid="rapid"
password="rapid"
print="yes"
classpathref="antclasspath">
Insert into ROLTA_PATCH_FILE_APP_TAB (PATCH_NO,FILE_NAME,FILE_PATH,FILE_VERSION,APPLIED_DATE,STATUS) values ('3.2.12',"@{detls}",'D:\ApEx_Schema\Functions\Functions.sql','3',to_date('11-MAR-11','DD-MON-RR'),'Y');
Insert into ROLTA_PATCH_TAB (PATCH_NO,PATCH_NAME,APPL_NAME,APPLIED_DATE) values ('3.2.12','2.1.11','@{detls}',to_date('11-MAR-11','DD-MON-RR'));
</sql>
</then>
</if>
</sequential>
</for>
=============== END ===========
고마워요 :) :) 작품! – Ajitesh
마틴 그것은 하나의 문자열을 위해 일했는데, u pls 파일에 여러 문자열에 대한 도움을 제안 할 수 ... 감사합니다 – Ajitesh
@Ajitesh - 업데이트, hth. –