ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anderson, Rob (Global Trade)" <Rob.Ander...@nike.com>
Subject RE: how to load a bunch data from a txt file, and ant sql call these data
Date Wed, 19 Mar 2008 22:56:37 GMT
I'm not trying to be a jerk, but you would probably benefit from reading
the following...

http://catb.org/~esr/faqs/smart-questions.html

I don't think anybody here is interested in doing your work for you. But
if you have specific questions about things you are having difficulty
with, we are happy to help if we can.

-Rob Anderson


-----Original Message-----
From: Chaohua Wang [mailto:cwang@incomm.com] 
Sent: Wednesday, March 19, 2008 3:52 PM
To: Ant Users List
Cc: floess@mindspring.com
Subject: how to load a bunch data from a txt file, and ant sql call
these data

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


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


Mime
View raw message