Leon Keylin wrote:
> Same result. I think the problem maybe with the
> extension module.
It could be (try using the more recent pyodbc
instead?) but in fact it worked for me, albeit
in the toy example I posted. However, there's
only so much mileage in working round a module's
possible inadequaci
on the dbserver used, but
PostgreSQL for example requires commits for everything (including statements
like CREATE TABLE).
Andreas
-- Ursprüngl. Mitteil. --
Betreff: Re: [Tutor] Truncating a Table
Von:"Leon Keylin" <[EMAIL PROTECTED]>
Datum: 11.05.2007 16:01
Yep, wor
Try commiting it. Actually that might depend upon the dbserver used, but
PostgreSQL for example requires commits for everything (including statements
like CREATE TABLE).
Andreas
-- Ursprüngl. Mitteil. --
Betreff:Re: [Tutor] Truncating a Table
Von:"Leon Keylin" <[EM
Leon Keylin wrote:
> Yep, works if I do it manually, under the same user.
And on other tables? (Just trying to narrow down).
Does this work:
import pymssql
db = pymssql (...)
q = db.cursor ()
q.execute ("CREATE TABLE #a (i INT)")
q.execute ("INSERT INTO #a (i) VALUES (1)")
q.execute ("SELECT
You either have autocommit enabled or you need to commit all data changes.
Can't tell the details as I'm not at my laptop :(
Andreas
-- Ursprüngl. Mitteil. --
Betreff: Re: [Tutor] Truncating a Table
Von:"Leon Keylin" <[EMAIL PROTECTED]>
Datum: 11
Yep, works if I do it manually, under the same user.
On 5/11/07, Tim Golden <[EMAIL PROTECTED]> wrote:
Leon Keylin wrote:
> Thanks Tim for a fast reply.
>
> The return gives me 0 Rows Truncated message and when I look at the
table,
> every record is still there.
> There are no foreign keys on t
Leon Keylin wrote:
> Thanks Tim for a fast reply.
>
> The return gives me 0 Rows Truncated message and when I look at the table,
> every record is still there.
> There are no foreign keys on the table and no errors.
>
> Andreas asked if I should commit after, should I? I didn't think I
> needed
Thanks Tim for a fast reply.
The return gives me 0 Rows Truncated message and when I look at the table,
every record is still there.
There are no foreign keys on the table and no errors.
Andreas asked if I should commit after, should I? I didn't think I needed to
but I can try that.
On 5/11/0
Leon Keylin wrote:
> Why would this not work?
>
> import pymssql
>
> con = pymssql.connect(host='server
> name',user='username',password='pwd',database='Database')
> cur = con.cursor()
>
>
> query="TRUNCATE TABLE Consolidatedmsgs;"
> cur.execute(query)
> print "Table Truncated: %d rows deleted"
Commit it?
Andreas
-- Ursprüngl. Mitteil. --
Betreff:[Tutor] Truncating a Table
Von:"Leon Keylin" <[EMAIL PROTECTED]>
Datum: 11.05.2007 15:39
Why would this not work?
import pymssql
con = pymssql.connect(host='server
name',user='username
Why would this not work?
import pymssql
con = pymssql.connect(host='server
name',user='username',password='pwd',database='Database')
cur = con.cursor()
query="TRUNCATE TABLE Consolidatedmsgs;"
cur.execute(query)
print "Table Truncated: %d rows deleted" % cur.rowcount
---
The return I g
11 matches
Mail list logo