Keith wrote:
Now I'm thorougly confused. I could've sworn this was working before (as I claimed in my first email to the group.


<fmt:parseDate value="${param.dob}" var="parsed_dob" pattern="dd-MM-yyyy" />


<sql:transaction>

<sql:update>
INSERT INTO resource_registry ( dob ) VALUES (? <sql:dateParam value="${parsed_dob}" type="date"/> )
</sql:update>


</sql:transaction>


This works perfectly fine when I put a date in the format specified in the parseDate action. The JSP book I got (O'Reilly 3rd Ed) says the <sql:dateParam> action is supposed to set the value to an SQL NULL when a null value is provided to it. I keep getting an Invalid Column Type SQL exception (not an Oracle error) back whenever I leave the date field blank. Anyone know what's wrong? Thanks!

It looks to me as if the "Invalid Column Type SQL exception" indeed comes from the database (or the JDBC driver), because nothing in JSTL can issue such an error message (JSTL doesn't have enough info; it just relays the error issued by the JDBC driver).

JSTL sets the parameter in the SQL statement to SQL NULL if the
<sql:dateParam> value is null (according to the spec; bugs in an
implementation is a different story). One possible reason for the
error you get is that the column isn't declared to accept a NULL
value. Check the database table constraints.

Hans
--
Hans Bergsten                                <[EMAIL PROTECTED]>
Gefion Software                       <http://www.gefionsoftware.com/>
Author of O'Reilly's "JavaServer Pages", covering JSP 2.0 and JSTL 1.1
Details at                                    <http://TheJSPBook.com/>


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to