I'm trying to build a dataframe from rows I select incrementally from a database.
SQL = '''select ..... where userid = ? and roleName = ?"" I use the UserId and Role Name from the file in my where clause.
SQL = '''select ..... where userid = ? and roleName = ?"" I use the UserId and Role Name from the file in my where clause.
for index, row in data.iterrows(): userid, rolename = row[['User Id', 'Role Name']] sql_query = pd.read_sql_query((SQL, (userid, rolename)), conn) <- This does not seem to be correct sqldf = pd.Dataframe(sql_query, columns = ['ApplicationName', 'Environment', 'LastName', 'FirstName', 'UniqueIdentifier', 'RoleName', 'UserId', 'AccountType']) conn.close() return