Joe Strout a écrit :
On Dec 15, 2008, at 6:46 AM, Krishnakant wrote:
in this case, I get a problem when there is ' in any of the values
during insert or update.
That's because ' is the SQL string literal delimiter. But any
SQL-compliant database allows you to "escape" an apostrophe within a
Hi steve.
you are right.
Thanks for all you who helped to understand how to and *not* to pass
queries through psycopg2 which is a module based on python dbapi.
the following query worked.
cursor.execute("insert into vendors values(%s,%s)", lstParams)
lstParams contained all the values and yes one h
Lamonte Harris wrote:
> I had this problem too. If you've upgraded to python 2.6 you need to
> use the new sytnax "format
>
> queryString = "insert into venders
> values('{0}','{1}','{2}'".format(field1,field2,field3)
>
Will all readers of this thread kindly regard this as an example of how
*not
On Mon, 15 Dec 2008 18:16:18 +0530, Krishnakant wrote:
hello all hackers.
This is some kind of an interesting situation although many of you must
have already gone through it.
I am facing a situation where I have to use psycopg2 and insert rows in
a postgresql table.
That's pritty easy and no ne
On 15 Des, 14:46, Krishnakant wrote:
> hello all,
> thanks for all of your very quick responses.
> The problem is that I am using python 2.5 so the 2.6 syntax does not
> apply in my case.
The parameter syntax for database operations is defined by the DB-API,
and this is a very different matter to
On Dec 15, 2008, at 6:46 AM, Krishnakant wrote:
in this case, I get a problem when there is ' in any of the values
during insert or update.
That's because ' is the SQL string literal delimiter. But any SQL-
compliant database allows you to "escape" an apostrophe within a
string literal by
hello all,
thanks for all of your very quick responses.
The problem is that I am using python 2.5 so the 2.6 syntax does not
apply in my case.
secondly, My problem is very unique.
I have created a function called executeProcedure in python which calls
stored procedures in postgresql.
The fun part o
sorry about that
queryString = "insert into venders
values('{0}','{1}','{2}')".format(field1,field2,field3)
On Mon, Dec 15, 2008 at 7:21 AM, Lamonte Harris wrote:
> I had this problem too. If you've upgraded to python 2.6 you need to use
> the new sytnax "format
>
> queryString = "insert into v
I had this problem too. If you've upgraded to python 2.6 you need to use
the new sytnax "format
queryString = "insert into venders
values('{0}','{1}','{2}'".format(field1,field2,field3)
On Mon, Dec 15, 2008 at 6:46 AM, Krishnakant wrote:
> hello all hackers.
> This is some kind of an interesti
On Mon, 15 Dec 2008 at 18:16, Krishnakant wrote:
how do you let the ' go as a part of the string?
I have used %s as placeholder as in
queryString = "insert into venders values ('%s,%s,%s" %
(field1,field2,field3 ) ...
This is not working for the ' values.
This is untested, but I think what you
hello all hackers.
This is some kind of an interesting situation although many of you must
have already gone through it.
I am facing a situation where I have to use psycopg2 and insert rows in
a postgresql table.
That's pritty easy and no need to say that it works well. But there are
some entries
11 matches
Mail list logo