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'm having the following issue with QGIS. Adding a sqlite text table (Layer > Add Vector Table) QGIS hides the primary key field (having name id). I understand also QGIS uses this field as unique id, but I need to have it in the attribute view because all my links and joins use this field. I'm not able actually to perform a join with my vector tables. I can neither change the column names, nor create views.

share|improve this question
    
can you share a sample of your data? –  Giovanni Manghi Aug 18 '12 at 15:48
    
I'll send a message to the qgis uselist with zip attached containing qgis project file & sqlite database, already loaded in the project. Opening attribute table in qgis no id field is shown. If you open the database with another software you'll see the table ha two fields, the first named id and set as primary key –  bradypus Aug 18 '12 at 21:41
    
Hi, it's not a spatialite db I want to add to my project, but a simple text table. I need to load external attributes from plain text tables and join with my vector layers. I'll not be able to perform the join until ID fields does not show up. I think that the missing ID field should be considered a bug, because we should be able to manage external data as they are, without filters. –  bradypus Aug 19 '12 at 8:16
    
@AndreJoost Could you post your comment as an answer? –  underdark Dec 18 '12 at 20:28

2 Answers 2

Although your question has already been answered in the comments. Why don't just add a new field to the attribute-table with the same name and select $id (or $rownum) as input in the field-calculator?

Something like this: enter image description here

share|improve this answer

I could analyze your problem a bit:

http://comments.gmane.org/gmane.comp.gis.qgis.user/18353

Adding the table to a sqlite database with already existing geometry tables solved the problem. And I used Add sqlite database (geometryless), not Add vector table.

share|improve this answer

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.