0

I create a Table in a Database and looks as following

test1=# SELECT * FROM stunden_Plan;
 stunde | montag | dienstag | mittwoch | donnerstag | freitag 
--------+--------+----------+----------+------------+---------
      1 |        |          |          |            |
(1 row)

From this distinction, I wanted to insert some values into the table below...

INSERT INTO stunden_Plan (stunde, montag, dienstag, mittwoch, donnerstag, freitag)
VALUES (2, "GLOBE-BE-154", "CH-SCH-156", "D-KR-477", "M-HA-477", "E-ZE-477" );

But I got an error of which I have no understanding!

ERROR:  column "GLOBE-BE-154" does not exist

I am grateful for any help. Thanks!

1

As documented in the manual string constants need to be enclosed in single quotes in SQL

INSERT INTO stunden_Plan (stunde, montag, dienstag, mittwoch, donnerstag, freitag)
VALUES (2, 'GLOBE-BE-154', 'CH-SCH-156', 'D-KR-477', 'M-HA-477', 'E-ZE-477' );

Double quotes are for identifiers

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.