• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

problem with temporary table..

 
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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....
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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"?
 
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic