Ans
Posts: 53
|
Posted: 05/30/2006, 11:41 PM |
|
I created a custom sql and place it in beforeExecuteInclude event (For some reason, CCS keeps crashing when i try to use custom insert)
Quote :JDBCConnection conn = JDBCConnectionFactory.getJDBCConnection("testDB");
long endweek = Utils.convertToLong(e.getRecord().getControl("endWk").getValue()).longValue();
long yr = Utils.convertToLong(e.getRecord().getControl("year").getValue()).longValue();
long ownID = Utils.convertToLong(e.getRecord().getControl("ownerID").getValue()).longValue();
String sql = "EXEC getMth "+
conn.toSql(String.valueOf(endweek),JDBCConnection.INTEGER)+
"," + conn.toSql(String.valueOf(yr),JDBCConnection.INTEGER)+
"," + conn.toSql(String.valueOf(ownID),JDBCConnection.INTEGER);
conn.executeUpdate(sql);
e.getCommand().setSql(sql);
conn.closeConnection();
I tried, but I got the error msg "[Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Error converting data type int to tinyint."
The 3 controls in the record is endwk(tinyint), year(smallint), ownerID(int).
How do I set the data type of the controls in the record form to tinyint/smallint. I tried using 'single' (not sure what data type is dat), but to no avail.
|
|
|
|