V
V
Vlad_Lop122021-05-06 19:53:29
Python
Vlad_Lop12, 2021-05-06 19:53:29

How to enter data with '?

Hello everyone, I ran into such a problem that I can’t enter the Piter dog's line because there is a sign '
The dogs column has a text data type

cur.execute(f'insert into test(dogs, status) values("Piter dog's",  True);')

Error: 
Command raised an exception: UndefinedColumn: column "Piter dog's" does not exist


I need to enter exactly in this format and without using truncation by index.
Please tell me what is wrong.
Thanks a lot!

Answer the question

In order to leave comments, you need to log in

3 answer(s)
V
Vlad_Lop12, 2021-05-06
@Vlad_Lop12

The question is closed.
I just made a function that changes ' to ''

R
Roman Kitaev, 2021-05-06
@deliro

Don't you know Backslash?

Y
Yupiter7575, 2021-05-06
@yupiter7575

string = """
"""

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question