I need to build up the contents of a table with multiple passes through it.
This partial code block produces
TypeError: not enough arguments for format string
Will insert not work inserting on a subset of columns, or is there something wrong with the syntax?
I have a workaround, which is to execute a mysql command line.
sql_cmd = \
"""
INSERT INTO synth_customer_synch
(
MeterID, AcctID, PremiseID, CustomerID, CustomerLastName,
CustomerFirstName, CompanyName, PremiseType, AddressLine1, AddressLine2,
City, State, Zip, Route
)
VALUES
%s, %s, %s, %s, %s,
%s, %s, %s, %s
in_row = in_cur.fetchone()
while None != in_row:
if in_row == None:
continune
lnam_fnam_l = parseLnamFnam(in_row)
out_row = \
in_row, in_row, in_row, in_row, lnam_fnam_l, \
lnam_fnam_l, in_row, in_row, in_row, in_row, \
in_row, in_row
out_cur.execute(sql_cmd, out_row)
Sorry!
Not 14 elements.
Log in to post a comment.
I need to build up the contents of a table with multiple passes through it.
This partial code block produces
TypeError: not enough arguments for format string
Will insert not work inserting on a subset of columns, or is there something
wrong with the syntax?
I have a workaround, which is to execute a mysql command line.
sql_cmd = \
"""
INSERT INTO synth_customer_synch
(
MeterID, AcctID, PremiseID, CustomerID, CustomerLastName,
CustomerFirstName, CompanyName, PremiseType, AddressLine1, AddressLine2,
City, State, Zip, Route
)
VALUES
(
%s, %s, %s, %s, %s,
%s, %s, %s, %s, %s,
%s, %s, %s, %s
)
"""
in_row = in_cur.fetchone()
while None != in_row:
if in_row == None:
continune
lnam_fnam_l = parseLnamFnam(in_row)
out_row = \
in_row, in_row, in_row, in_row, lnam_fnam_l, \
lnam_fnam_l, in_row, in_row, in_row, in_row, \
in_row, in_row
out_cur.execute(sql_cmd, out_row)
Sorry!
out_row = \
in_row, in_row, in_row, in_row, lnam_fnam_l, \
lnam_fnam_l, in_row, in_row, in_row, in_row, \
in_row, in_row
Not 14 elements.