By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
439,986 Members | 1,583 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 439,986 IT Pros & Developers. It's quick & easy.

sqlite & python 2.5

P: n/a
Hi,
I am using python 2.5 under windows. I am trying to do the below:

cursor.execute("SELECT postid, title, body, teaser, postdate,
posttime, author, status, format, allow_comments, notify_on_comments,
catname \
FROM ton_posts p, ton_category c \
where c.catid = p.category and status = 1 and strftime('%Y',
p.postdate) in(?) and strftime('%m', p.postdate) in(?) and c.catid
in(?)\
order by postdate desc, posttime desc",sqlvars)

print cursor.fetchall()

But it always returns empty (though there is value in db).

For ref:
sqlvars = ("select distinct strftime('%Y',postdate) from ton_posts",
"select distinct strftime('%m',postdate) from ton_posts", 'select catid
from ton_category')

Is there anyway I can find out the sql that gets executed (after the
varible substitution)?

Also can anyone help me out in finding out what is wrong here?

Thanks a lot
Joseph

Oct 14 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.