Problem Executing Query from python script

Hi to all.

From PostgreSQL prompt:

mettust=# select * from sales;

mettust=# select * from sales offset(select count(*)-3 from sales);

From terminal:

python code:

output of the code:

Mistake : Hello Friends i committed simple mistake in the python code i forget to use the fetchall() method

(i.e)

cur.execute(“””select * from sales offset(select count(*)%d from sales);”””%self.cou)
disp=cur.fetchall()
print disp
Like this. Hope hereafter i wont commit mistakes like this.
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s