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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T04:07:13+00:00 2026-05-21T04:07:13+00:00

it inserts same value every time. import re import MySQLdb db = MySQLdb.connect(localhost,root,123,tc )

  • 0

it inserts same value every time.

import re
import MySQLdb
db = MySQLdb.connect("localhost","root","123","tc" )
cursor = db.cursor()
for x in range(1,2):
        file = '/tmp/tc/'
        file +=`x`
        file +=".txt"
        f = open(file, 'r')
        print x
        listTC = re.findall(r'[1-9]{1}[0-9]{10}', f.read())
        for item in listTC:
                print item
                sql = "INSERT INTO TCNO (tcno) VALUES(%s);"
                cursor.execute(sql % (item))

OUTPUT in MYSQL SERVER:

| 94006 | 2147483647 | NULL |
| 94007 | 2147483647 | NULL |
| 94008 | 2147483647 | NULL |
| 94009 | 2147483647 | NULL |
| 94010 | 2147483647 | NULL |
| 94011 | 2147483647 | NULL |
| 94012 | 2147483647 | NULL |
| 94013 | 2147483647 | NULL |
| 94014 | 2147483647 | NULL |
| 94015 | 2147483647 | NULL |
| 94016 | 2147483647 | NULL |
| 94017 | 2147483647 | NULL |
| 94018 | 2147483647 | NULL |
| 94019 | 2147483647 | NULL |
| 94020 | 2147483647 | NULL |
| 94021 | 2147483647 | NULL |
| 94022 | 2147483647 | NULL |
| 94023 | 2147483647 | NULL |
+-------+------------+------+
94023 rows in set (0.11 sec)

However, in the console when I am printing the item:

69619195972
32386362700
70930135288
20371250224
25069684954
32414357302
55660438298
12352807312
18566819172
53425735712
19622042220
34060374108
49126586180
13184124554
18772590346
38074262024
37765310686
15491265104
16139670014
16799684314
22231833554
22231833554
21389016246
44923993452
50902266134
30742937128
34071994144
35011994174
  • 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-05-21T04:07:13+00:00Added an answer on May 21, 2026 at 4:07 am

    2147483647 is 0x7fffffff, so probably you hit max signed int value.

    Take a look on data type on the field at database designers, and probably use Big Integer or something bigger one.

    ref: http://dev.mysql.com/doc/refman/5.0/en/numeric-types.html#id603844

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

Sidebar

Related Questions

I set it up so that every time you view a product a value
I have a script that did double inserts into the database with the same
Our security manager dynamically inserts a bit of javascript at the top of every
In the below XSL every time the xsl:when gets satisfied I want to append
So, I'm learning Access 2007, Visual Basic, and SQL at the same time. Not
Possible Duplicate: Hibernate: different object with the same identifier value was already associated with
I have two insert statements, almost exactly the same, which run in two different
I have a SQL script that inserts data (via INSERT statements currently numbering in
I have a migration in Rails that inserts a record into the database. The
I'm looking for a good way to perform multi-row inserts into an Oracle 9

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.