Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I have python code that I am executing but it gives me following error:

<sqlite3.Cursor object at 0x7f3c7666dc00>

when I execute the cur.execute(statement). the code that is below the cur.execute is not read and nothing gets written. here is part of the code i am using

statement = 'select "index",path,id from %s' %(table,) + " WHERE done IS NULL AND job = '%s';" %(job,)
cur.execute(statement)
for row in cur:
    print row
    pszFilename = row[1]
    name = os.path.basename(pszFilename)
    foo = int(name[2:4])
    if foo%2 == 0:
        meridian = foo + 1
    else: meridian = foo     
    print 'meridian: ',meridian
share|improve this question
4  
Seems not a GIS question, perhaps you should consider moving it to StackOverflow? –  unicoletti Dec 20 '12 at 13:08
    
Try printing statement to make sure it really looks like you expect it to, and then try that in the sqlite shell as suggested by kyle. –  BradHards Jan 20 '13 at 0:44
add comment

1 Answer

I would guess it is working, but your sql returns no rows. Try hooking up to the database with the sqlite3 shell and check your sql. I've found that sqlite is pretty quiet with incorrect sql (tables don't exist, etc). Another observation, although it's a guess, since you posted on the GIS forum and use the GDAL like variable name pszFilename, you can use the ogr sqlite driver to read from a sqlite database. Fetch a layer, set an attribute filter on the layer and iterate through the features.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.