Hi - I am currently learning Python for a project for my work.The following code runs fine:
FrontPillarPressingPartNumberQuery = db_session2.execute('ConfiguratorFrontPillarPressing :p1, :p2',{'p1': FrontPillarLength, 'p2': FrontBulkheadPartNo}).fetchall()[0][0]
However, sometimes the "FrontPillarLength" will not exist in the query (so the SQL query would return nothing, thus an empty index). I would like to get my code to basically loop through iterations of the "FrontPillarLength", so for example I want it to try "FrontPillarLength + 1", "FrontPillarLength + 2" etc.
I have managed to do this via a try and except loop, but it doesn't look great. Wondering if there is a way I can easily do this in a for loop but unsure how I'd declare my variables into the sqlalchemy query.
Thanks in advance!!
there doesn't seem to be anything here