Dieter Maurer wrote:
> M.-A. Lemburg wrote at 2006-4-19 20:36 +0200:
>> ...
>> Actually, I don't think that parsing SQL is really necessary
>> at all: in all the years I've used qmark style, I've never come
>> across a situation where a SQL literal would include a question
>> mark.
>
> I do not th
I have the following code:
UPDATE mytable SET col1 = %s, col2 = %s, col3 = %s, col4 = %s,
col5 = %s, col6 = %s WHERE name = %s
""", (tuple(entries)))
In this example, entries is a list of numbers and the last element is a name of
a target.
This works fine. But, there will be times whe
On Apr 24, 2006, at 11:35, Patty wrote:
> I have the following code:
>
> UPDATE mytable SET col1 = %s, col2 = %s, col3 = %s, col4 = %s,
> col5 = %s, col6 = %s WHERE name = %s
> """, (tuple(entries)))
> In this example, entries is a list of numbers and the last element is
> a name of
>
William Dode wrote at 2006-4-22 18:53 +:
>I search for a generic way (for psycopg, mysqldb, adodbapi) to
>know that the connexion is closed
I fear there is no generic way
--
Dieter
___
DB-SIG maillist - DB-SIG@python.org
http://mail.python.or
Hi again,
> query_string = "update mytable set " + ",".join ( [ key + "=%s" for
> key, value in d_items ] )
>
> cursor.execute ( query_string, tuple ( [ value for key, value in
> d_items ] ) )
>
Thanks for your prompt reply. I kinda got it, but the the part that I forgot to
mention was that
On Apr 24, 2006, at 13:37, Patty wrote:
>
> Hi again,
>
>> query_string = "update mytable set " + ",".join ( [ key + "=%s" for
>> key, value in d_items ] )
>>
>> cursor.execute ( query_string, tuple ( [ value for key, value in
>> d_items ] ) )
>>
>
>
> Thanks for your prompt reply. I kinda got it
Got it!! Thank you
___
DB-SIG maillist - DB-SIG@python.org
http://mail.python.org/mailman/listinfo/db-sig
In reference to finding question marks in SQL queries and ignoring
string literals
M.-A. Lemburg wrote:
> Does anyone know a good implementation of such a search&replace
> mechanism ?
>
I've not seen any existing code to deal with this BUT there are a couple
of places to check:
* SnakeSQ
Chris Clark wrote:
> In reference to finding question marks in SQL queries and ignoring
> string literals
>
> M.-A. Lemburg wrote:
>>Does anyone know a good implementation of such a search&replace
>>mechanism ?
>>
>
> I've not seen any existing code to deal with this BUT there are a couple
>
On Mon, Apr 24, 2006, Dieter Maurer wrote:
>William Dode wrote at 2006-4-22 18:53 +:
>>I search for a generic way (for psycopg, mysqldb, adodbapi) to
>>know that the connexion is closed
>
>I fear there is no generic way
One could use something like:
try: cur = conn.cursor()
except: cur =
10 matches
Mail list logo