468,305 Members | 1,539 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,305 developers. It's quick & easy.

sqlite & python 2.5

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
0 789

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by Pajo | last post: by
12 posts views Thread by John Salerno | last post: by
14 posts views Thread by 7stud | last post: by
3 posts views Thread by ricardo.turpino | last post: by
1 post views Thread by mikhail.savitsky | last post: by
3 posts views Thread by kyosohma | last post: by
reply views Thread by Guilherme Polo | last post: by
reply views Thread by Joe Goldthwaite | last post: by
20 posts views Thread by timotoole | last post: by
reply views Thread by NPC403 | last post: by
reply views Thread by Teichintx | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.