This works if I go straight to TOAD and enter the SQL statement insert manually. But going from my app doesn't work. I am using Vignette portal on Weblogic 8.1, Oracle DB 10g, and ojdbc14.jar for the connection pool. I have read countless examples and no one else seems to have issues - maybe someone can spot my error. I am getting an exception but the exception message is NULL. I am not finding any errors in the log files. Here's the code:
// Create SQL statement
sSQL="INSERT INTO PORTALTABLE (ID, DATE, TITLE, LEADER, "
+ "PATH, BODY "
+ ") VALUES ("
+ "SEQ_ID.nextval, "
+ "TO_DATE('" + sEnteredDate + "','MM/DD/YYYY HH24:MI'), "
// Insert the new record into DB
initCtx = new InitialContext();
ds = (DataSource)initCtx.lookup(JDBCConn);
conn = ds.getConnection();
PreparedStatement ps = null;
ps = conn.prepareStatement(sSQL);
plog.log("InsertStory : empty_clob inserted");
You are setting values before initializing PreparedStatement with ps = conn.prepareStatement(sSQL).
empty_clob() is working fine within jdbc, as Oracle documentation says and as far as I have tested.
and the control select statement:
Joined: Nov 08, 2007
You are absolutely correct! I can't believe I did not "see" that. It just shows that sometimes we get too close and cannot see the details. I have corrected my code and of course it works just fine. I appreciate your input and I will try not to repeat that mistake.
Have a great week.