mysql sql statement running in ANT



I have a script in ANT to load data from a data file and then update a tmp
table.

My problem is that when I run the following sql under mysql client, it works
perfectly. However, when ever I run it in ANT, nothing can be insert into
the temp table.

I have tried to test the result that the data has already been loaded. The
record can be selected from the newly loaded table( DAILY ) but there will
be zero records inserted into the temp table ( the last sql ) . I cannot
figure out the reason for this strange behaviour. Can anyone explain this
to me ?


<target name="loadData" depends="clearData">
<echo message="LOAD DATA USING: ${db.driver} ${db.url}"/>
<sql driver="${db.driver}"
url="${db.url}"
userid="${db.user}"
password="${db.pw}"
autocommit="true"
onerror="continue"
print="true">
<classpath refid="master-classpath"/>

LOAD DATA LOCAL INFILE '${data.dir}/2.csv'
INTO TABLE DAILY
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
(HSI_D_DATE, D_OPEN, D_HIGH, D_LOW, D_CLOSE, D_VOLUMN);

update DAILY
SET D_SETTLE_DATE=DATE_FORMAT(D_DATE, '%Y-%m-01');

### create temp table ###
DROP TEMPORARY TABLE IF EXISTS tmp_last_month_day;
CREATE TEMPORARY TABLE tmp_last_month_day (
settle_date date
);

### insert last month day into temp table ###
INSERT INTO tmp_last_month_day(
settle_date
)
select max(D_DATE)
from DAILY
GROUP BY D_SETTLE_DATE;


##########################################################


.



Relevant Pages

  • Re: vb6 multicol combo
    ... I have trying to load data into combobox by using ... i am not sure why does it gives me error that invalid procedure or call? ... What is the data type of your temp variable? ... The 2nd parameter of the ComboBox's AddItem method is an index specifying ...
    (microsoft.public.vb.general.discussion)
  • vb6 multicol combo
    ... I have trying to load data into combobox by using ... temp = rs!id ... i am not sure why does it gives me error that invalid procedure or call? ...
    (microsoft.public.vb.general.discussion)
  • Re: vb6 multicol combo
    ... I have trying to load data into combobox by using ... i am not sure why does it gives me error that invalid procedure or call? ... The combobox that ships with VB has no support, at all, for multiple ... .ItemData= temp ...
    (microsoft.public.vb.general.discussion)