id_producenta is primary key (int) for table producent I need to find unique value for it, I use that code: dbh.query('select id_producenta from producent'); res=dbh.store_result() how=res.num_rows(); id=[] for i in range(how): r=res.fetch_row() id=id+[int(r[0][0])] del res return max(id)+1; Looks quite long... how to write it in better way? -- Now the best steel goes through the fire And you seem to burn The dead man's always a liar "Hide In The Rainbow" Look out! there's another one learning! - Ronnie James Dio
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4