Gregory,
I usually have 2 problems with JDBC and MS SQL Server (They are JDBC-ODBC
bridge issues, I think). First, when I declare a column with width lesser
than that of inserted string. Second, when I use prepared statements with
long varchar parameters. In the latter case, I assemble SQL query
dynamicly - something like this:
<%
String sqlQuery="INSERT INTO news (newsletter_ID, heading, entry,
enteredby) VALUES ("+
newsletter_ID+", "+
heading+", "+
entry+", "+
enteredby+") ";
%>
<jrun:sql datasrc="afdallas" id="allnews">
<%=sqlQuery%>
</jrun:sql>
I'm not sure in the tag part of the example, but I think the idea is clear.
With best regards,
Vitaly.
----- Original Message -----
From: "Gregory Price" <[EMAIL PROTECTED]>
To: "JRun-Talk" <[EMAIL PROTECTED]>
Sent: Friday, August 17, 2001 3:19 AM
Subject: SQL Server Memo Insert problem
> Hey,
> I'm a ColdFusion / Jrun convert and could use a little help... Having
trouble getting a large record to update (datatype varchar, 8000 character
limit) using jrun. A small entry into the subsiquent textarea works no
problem, but when I insert text over about 3500 characters I get a
>
> "JspTagException: [Microsoft][ODBC SQL Server Driver]String data, right
truncation"
>
> The string data, right truncation had me double checking the datatype and
trying the insert of like characteristics in ColdFusion and it worked like a
champ. So that tells me it is in the jsp or Jrun Driver or something... not
in the database itself. The code I am using for the insert is :
>
> <%@ taglib uri="jruntags" prefix="jrun" %>
>
> <% String news_ID= request.getParameter("news_ID"); %>
> <% String newsletter_ID= request.getParameter("newsletter_ID"); %>
> <% String heading= request.getParameter("heading"); %>
> <% String entry= request.getParameter("entry"); %>
> <% String enteredby=request.getParameter("enteredby"); %>
> <% String newslettermonth= request.getParameter("newslettermonth"); %>
> <% String newsletteryear= request.getParameter("newsletteryear"); %>
>
> <jrun:sql datasrc="afdallas" id="allnews">
> INSERT INTO news (newsletter_ID, heading, entry, enteredby)
> VALUES (
> <jrun:sqlparam value="<%= newsletter_ID %>" />,
> <jrun:sqlparam value="<%= heading %>" />,
> <jrun:sqlparam value="<%= entry %>" />,
> <jrun:sqlparam value="<%= enteredby %>" />
> )
> </jrun:sql>
>
> This, of course, comes from a form submitted by virtue of method="post".
The problem occurs upon submission of the "entry" field... I am using these
settings to connect:
>
> sun.jdbc.odbc.JdbcOdbcDriver
> jdbc:odbc:afdallas
>
>
>
> I am new at this, and look forward to participating in this list... thanks
in advance for any help you can throw my way...
> Thanks
> Greg Price
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists