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 8330335
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T02:05:36+00:00 2026-06-09T02:05:36+00:00

I am getting many warnings of the same kind — Warning: Truncated incorrect DOUBLE

  • 0

I am getting many warnings of the same kind —

Warning: Truncated incorrect DOUBLE value: '512121500B'

— but cannot figure out why.

The MySQL table dr_snapshot looks like this:

PremiseID char(10) Primary Key
cycle SMALLINT(6)
last_read DATETIME
reading INTEGER
DeviceID INTEGER

I want to delete many rows by PremiseID. Here is one in particular: ‘512121500B’.

Here is my Python function that deletes by PremiseID:

def delDrSnapRow(premiseID, db):
    sql_cmd = " ".join([
        "delete ",
        "from dr_snapshot ",
        "where PremiseID = " + str(premiseID) + " ; "])

    del_cur = db.cursor()
    rc = del_cur.execute(sql_cmd)
    del_cur.close()

    return rc

PremiseID is a string, not a double. What am I missing here?

Many thanks.

Edit

After modifying my delete procedure to use try: .. except, I am not seeing the warning. I believe I am not seeing the warning, because I’m not seeing the warning display — print(e) — in the except part.

I am left with the conclusion that the try: except somehow removed the error.

def delDrSnapRow(premiseID, db):
    sql_cmd = " ".join([
        "delete ",
        "from dr_snapshot ",
        "where PremiseID = " + "'" + premiseID + "' ; "])

    del_cur = db.cursor()

    try:
        rc = del_cur.execute(sql_cmd)

    except MySQLdb.Error, e:
        print "Error %d: %s" % (e.args[0], e.args[1])

    except MySQLdb.Warning, e:
        print(e)
        rc = del_cur.execute(sql_cmd)

    del_cur.close()

    return rc
  • 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-09T02:05:37+00:00Added an answer on June 9, 2026 at 2:05 am

    Look at this line "where PremiseID = " + str(premiseID) + " ; "])". The comparison is happening on different types and when MySQL compares different datatypes they are cast to DOUBLE internally before comparison. So you can try putting single quote around or cast around to solve the issue. So it’s not try catch but the quotes which resolve the issue.

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

Sidebar

Related Questions

I am getting many of the following warning messages. Is this something I should
I'm getting into SDK documentation, but this site has so many eyes and great
I'm getting this error: Warning: mysql_connect() [function.mysql-connect]: Too many connections in /home1/host/public_html/employee/message/config.php on line
My apns was fine till yesterday. But today onwards am getting this error. .Warning:
I'm getting many failures from the CSRF Django middleware on my site (the version
I have read many answers regarding this still i am getting confused if i
I know there are many tutorials out there for getting started in C. However
I am getting 403 Errors from Apache when I send too many, 12, synchronous
I am having some problems getting a larger application with many table relationships working
I’m getting hopeless on this. Modelling a simple one-to-many relationships with Google App Engine

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.