CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> Java

 Error converting data type int to tinyint

Print topic Send  topic

Author Message
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.
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.