Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem with temporary table..

 
toukhir mujawar
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i m trying to insert the data into the global temporary table.. and then copying it to the master table.. it is not insertingdata..

the code is


PreparedStatement st =
conn.prepareStatement("insert into tbl_jv01_temp (rec_type,sys_code,bu,pc_mth,pc,zone,circle,div,subdiv,jv_cat,trf_cd,amt_type,amount,acct_type,cc_code,std_mth,pr_mth,bill_dt,due_dt,run_dt,run_time,rtrf,prc_mth,version,tag1) values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
// set the parameters
st.setString(1, getRecType());
st.setString(2, getSysCode());
st.setInt(3, getBu());
st.setInt(4, getPcMth());
st.setInt(5, getPc());
st.setInt(6, getZone());
st.setInt(7, getCircle());
st.setInt(8, getDiv());
st.setInt(9, getSubDiv());
st.setInt(10, getJvCat());
st.setInt(11, getTrfCd());
st.setInt(12, getAmtType());
st.setBigDecimal(13, getAmount());
st.setString(14, getAcctType());
st.setInt(15, getCcCode());
st.setInt(16, getStdMth());
st.setInt(17, getPrMth());
st.setInt(18, getBillDt());
st.setInt(19, getDueDt());
st.setInt(20, getRunDt());
st.setString(21, getRunTime());
st.setInt(22, getRtrf());
st.setInt(23, getPrcMth());
st.setInt(24, getVersion());
st.setInt(25, getTag1());
int count = st.executeUpdate();
st.close();
conn.close();

PreparedStatement st= conn.prepareStatement("insert into tbl_jv01_master select * from tbl_jv01_temp");
int count = st.executeUpdate();

it is not giving any exception... just cant find please help me....
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34973
379
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Toukhir,
Which of the two isn't inserting data? In other words, what is the return value of the first "count"?
 
Josh Juneau
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you using an IDE? I find that using the debug feature on an IDE can really help in this situation.

For instance, in most IDEs (I use NetBeans) it is helpful to set up a break point at your SQL statement. That way when you debug the application, you can walk through exactly what is happening when it runs. I find it very useful in this type of situation.

My 2 cents...
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24212
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please don't post the same question to more than one forum. See here for an explanation of why I just deleted several other copies of this thread.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic