Return multiple rows in python function

Viewed 30

Am trying to print multiple rows with the return statement, but it is printing only one record.

def extract(self):
    data = self.oracle_conn().execute('select * from employees').fetchall()
    for row in data:
        
        return row

enter image description here

Any suggestion will be helpful to print multiple lines without using pandas

1 Answers
def extract(self):
    data = self.oracle_conn().execute('select * from employees').fetchall()
    for row in data:
        yield row
Related