ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chaohua Wang" <cw...@incomm.com>
Subject how to load a bunch data from a txt file, and ant sql call these data
Date Wed, 19 Mar 2008 22:51:52 GMT
Hi Folks,

I have a ant sql statement 


<target name="insertData">
		<sql driver="${jdbcdriver}" url="${dburl}/BillPay"
userid="${userid}" password="${password}"
			print="yes" onerror="continue"
output="${tmp.dir}/dbModification.txt">
			<transaction> INSERT INTO Payment (RefNumber,
VAN, Amount, OptCode, VendorID,
				PriorRefNumber, TransactionTS,
IsProcessed) VALUES
	
('6569998989','2131213','1131',2031,232,'7898', { fn NOW() },1);
</transaction>
			<transaction> INSERT INTO Payment (RefNumber,
VAN, Amount, OptCode, VendorID,
				PriorRefNumber, TransactionTS,
IsProcessed) VALUES
	
('9565689232323','21313213','1131',2031,232,'7898', { fn NOW() },1);
</transaction>
		</sql>

Here there are 2 sql statement to insert. But I have more than 100 data
put in txt file.

Like this
'1569998989','2131213','1131',2031,232,'7898', { fn NOW() },
'2569998989','2131213','1131',2031,232,'7898', { fn NOW() },
'3569998989','2131213','1131',2031,232,'7898', { fn NOW() },


Could you tell me How can load these data from a txt file. And using
loop to insert these data into database. Which means dynamically.
So I don't need to put  more thant 100 sql statement in the ant build
file. 

Thank you very much.

Cwang



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message