O
O
Oleg Petrov2018-11-27 12:29:18
Python
Oleg Petrov, 2018-11-27 12:29:18

Is there a way in Python to see a column that starts with a capital letter and has spaces?

There is a database in which you cannot change the name of the column, but you need to work with it.
I have already tried 1000 ways, and not one has helped.
I want to do a select in Python in ANY way and get the value of a column with such names: "Table 1", "New system"
I would be grateful for any advice.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2018-11-27
@NeiroNx

If you take SQLAlchemy, then something like this:

class MyTable(db.Model):
    __tablename__='Table 1'
    id = db.Column(db.Integer, primary_key = True)
    newSystem = db.Column('New System',db.String())

in general, names in POSTGRES are always lowercase.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question