cancel
Showing results for 
Search instead for 
Did you mean: 

Query Parameter Data Type error betwee IE6 and IE7

Former Member
0 Kudos

Hello all.

This is a strange one. Using MII v12. When setting parameters for a SQL query from Javascript, the query executes properly on IE7 but generates errors on IE6. The errors are JDBC errors having to do with "Conversion failed when converting datetime from character string." and "Error converting data type varchar to numeric." I don't get any browser errors, only Java errors and NetWeaver log entries.

What is the source of this data typing error?

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

There are some differences in how IE6 and IE7 parse javascript. without seeing your code its hard to see what the issue is.

May I suggest using an applet do the dateformatting for you?

formatDate(String strDate, String fromFormat, String toFormat)

That way you take it out of the hands of IE's javascript parser.

Former Member
0 Kudos

Good idea. However I am more concerned with the general issue of why it works on IE7 and not on IE6.

Former Member
0 Kudos

Well the error you are getting is a data formatting issue (I assume you are trying to pass a datetime to SQL) so SQL is not liking what you are sending it. As a test why not look at what the output of your js function is. say in an alert box or text form. That way you can compare what IE6 puts out vs IE7.

Former Member
0 Kudos

I understand. That is a basic troubleshooting tool that I use a lot. But what is the source of the issue? Are there some scripting rules that help you avoid it in the furture?

Former Member
0 Kudos

Hi, Sparks.

Actually, IE was always an anomaly when it came to proper typing of objects in Javascript, so it let you get away with things that really shouldn't work.

In general, you should use the Number Javascript type for number properties (e.g. setRowCount(), setXAxisMinRange(), etc) and strings for just about everything else. If I recall, Javascript will handle most of the type conversions to a String property, but not necessarily to a Number property.

You can use the parseInt() and parseFloat() methods to convert from strings to numbers in Javascript.

In general, it's a good practice to be "type aware" in your Javascript code anyway, and this will ensure that it runs in other browsers and future browsers.

Rick