Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8420355
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T02:52:12+00:00 2026-06-10T02:52:12+00:00

I have a input field <body> <center> <div style=margin-top : 1px; border:1px solid #e4e4e4;

  • 0

I have a input field

    <body>
    <center>
    <div style="margin-top : 1px; border:1px solid #e4e4e4; width : 500px; background: #efefef; box-shadow : 0px 0px 20px 10px #e5e5e5 inset;">
        <p style="font-size: 18pt; font-family: verdana; text-shadow: 0px 0px 4px #000; color:#fff;">Student Exam Data</p>
        <form onsubmit="return message()">
            <p class="heading">Student Details</p>
            <p class="data">
                <label>Roll Number</label><input type="text" name="rollno" id="rollno" maxlength="4"/>
            </p>
            <p class="heading">Marks Obtained For Languages</p>
            <p class="data">
                <label>English</label><input type="text" name="english" id="english" onchange="calculate()" maxlength="3"/>
            </p>
            <p class="data">
                <label>Konkani</label><input type="text" name="konkani" id="konkani" onchange="calculate() maxlength="3""/>
            </p>

            <p class="heading">Marks Obtained For Natural Science</p>
            <p class="data">
                <label>Maths</label><input type="text" name="maths" id="maths" onchange="calculate() maxlength="3""/>
            </p>
            <p class="data">
                <label>Physics</label><input type="text" name="physics" id="physics" onchange="calculate() maxlength="3""/>
            </p>
            <p class="data">
                <label>Chemistry</label><input type="text" name="chemistry" id="chemistry" onchange="calculate() maxlength="3""/>
            </p>

            <p class="heading">Marks Obtained For Social Science</p>
            <p class="data">
                <label>Geography</label><input type="text" name="geography" id="geography" onchange="calculate() maxlength="3""/>
            </p>

            <p class="heading">Total Marks Obtained</p>
            <p class="data">
                <label>Total Marks</label><input type="text" name="total" id="total" readonly="readonly"/>
            </p>

            <p class="heading">Percentage</p>
            <p class="data">
                <label>Percentage</label><input type="text" name="percentage" id="percentage" readonly="readonly"/>
            </p>

            <p>
                <input type="submit" value="Submit">
            </p>

            <input type="hidden" name="mode" value="set">

        </form>
    </div>
    </center>



    <c:if test="${param.mode == 'set'}">

    roll number<c:out value="${param.rollno}"></c:out>
        <c:catch var="exception">
            <sql:setDataSource var="examDatabase" password="" user="root" driver="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost/examination"/>
            <sql:update var="result" sql="insert into student_examdata values(?,?,?,?,?,?,?,?,?)" dataSource="${examDatabase}">

                <sql:param value="${param.rollno}.trim()"></sql:param>
                <sql:param value="${param.english}.trim()"></sql:param>
                <sql:param value="${param.maths}.trim()"></sql:param>
                <sql:param value="${param.physics}.trim()"></sql:param>
                <sql:param value="${param.chemistry}.trim()"></sql:param>
                <sql:param value="${param.konkani}.trim()"></sql:param>
                <sql:param value="${param.geography}.trim()"></sql:param>
                <sql:param value="${param.total}.trim()"></sql:param>
                <sql:param value="${param.percentage}.trim()"></sql:param>
            </sql:update>
        </c:catch>



        <c:if test="${exception != null }">
            <p class="error">
            <strong style="background : #fff; color:#000; width : 300px;">Exception</strong><br><br>
            <c:out value="${exception.message}"></c:out>
        </p>
        </c:if>

    </c:if>



</body>

the data type of the field roll_no is varchar(4).

Error is:
insert into student_examdata values(?,?,?,?,?,?,?,?,?): Data truncation: Data too long for column ‘roll_no’ at row 1

please help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T02:52:13+00:00Added an answer on June 10, 2026 at 2:52 am

    something is seriously wrong here!

    <sql:param value="${param.rollno}.trim()"></sql:param>
    

    if you are trying to trim the rollno, please use this

    <sql:param value="${param.rollno.trim()}"></sql:param>
    

    i hope that will answer your problem!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple input field inside a form tag: <body> <form action=#> <label>Input</label>
I have a input field with a name attribute like field[subkey][subkey2] How can I
I have one input field and one division with span children <input type=text id=input
I have an input field that is by default set to type=text so that
I have an input field which has a placeholder text. I want one word
I have an input field whose name is an MD5 string e.g.: <input type=hidden
I have an input field and I want to limit it to alphanumerical (A-Z,
I have an input field in a form. Upon pushing submit, I want to
I have an input field that uses Autocomplete to show a list of possible
i have an input field which will be displayed. i want that to hide

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.