473,407 Members | 2,546 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

mx.ODBC minor problem


Hello all,
In a script i just wrote, my code calls a function createTables(), which
checks for an existing table and then creates it, and then immediately calls
selectSQL(), which selects from a different table and inserts on the table I
just created (see below).

However, I continue to get an Interface Error (see below) when i run it. And
yet, if I allow the code to call createTables() and then manually call
selectSQL() after a couple seconds, the thing works fine. In short, there's
no mismatch in the number of parameters. Why would this be? I've never
experienced this before. How can i restructure my code to resolve this
problem?
---
CODE
---
def createTables():
# Drop AddScript Table
try:
curse.execute('Drop table ' +countyname+'ADD_SCRIPT_TABLE')
conn.commit
except:
pass
# Create AddScript Table
curse.execute('Create table ' +countyname+'ADD_SCRIPT_TABLE'+ ' (TISCODE
TEXT(12), STATUS TEXT(4))')
conn.commit()

def selectSQL():
sql = "Select TISCODE,STATUS from " +countyname+"0"+ " where STATUS =
'AS'"
curse.execute(sql)
a = curse.fetchall()
curse.executemany('Insert into ' +countyname+'ADD_SCRIPT_TABLE'+ '
(TISCODE,STATUS) values (?,?)',x)
conn.commit()
---
ERROR
---
InterfaceError: mismatch in number of parameters; expected 2, found none
--
View this message in context: http://www.nabble.com/mx.ODBC-minor-....html#a9971678
Sent from the Python - python-list mailing list archive at Nabble.com.

Apr 13 '07 #1
0 874

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Sean Anderson | last post by:
ODBC under System DSN Setup Access Driver give it the DSN (Data Source Name) MSA Click on Select and point to the myfile.mdb (your database file)
10
by: Kim Petersen | last post by:
Regarding ODBC usage in Python... it seems to me that there is a couple of ways to use odbc from python, one of these is the MX version - now that one has a pretty steep licence cost (imho). So...
3
by: Joe | last post by:
Python 2.4 Windows XP SP2 MS Access 2000 mx.ODBC 2.0.7 Problem data truncation occuring (here's the actual error message): mxODBC.Warning: ('01004', 5, ' String data, right truncated on...
11
by: Wolfgang Kaml | last post by:
Hello All, I have been working on this for almost a week now and I haven't anything up my sleeves anymore that I could test in addition or change.... Since I am not sure, if this is a Windows...
6
by: Andreas Lauffer | last post by:
I changed from Access97 to AccessXP and I have immense performance problems. Details: - Access XP MDB with Jet 4.0 ( no ADP-Project ) - Linked Tables to SQL-Server 2000 over ODBC I used...
3
by: kakaz | last post by:
Hi All there! I am quite new in MS SQL administration so let me explain how it work on Your instances of SQL Servers. We have several DTS packages on our server, all of them managed on some...
2
by: uli2003wien | last post by:
Dear group, we are dealing with some very specific problems with ODBC, where a connection from SQL-Server to Mysql works with ODBC-driver 3.51.10.00 and does NOT work with ODBC-driver...
2
by: xiaotom | last post by:
I want my software to be independant of operation system and databases. That's why I want to use odbc, and don't want to use MFC. Here I have some questions to ask: 1. On unix (like sun...
14
by: dananrg | last post by:
Been using the ODBC module for Python 2.1 (Win32) and had another question. When I return data from date columns, it's in a strange object form, e.g. <something or other> (don't have the output in...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.