Skip to content
Advertisement

Why does my “INSERT INTO” Statement not work?

I am working with Apache derbyDB (db2) and SQL Workbench as environment. I have 10k records of data and I want to create a star schema with dimension tables and a fact table.

In the Facts table (DM_PRICE_PAID_RECORDS) I only want to have the the primary key, the price (fact) and the ID, to have a relation to the dimension table but its not working.

I wouldve expected this as an outcome:

TRANSACTION_ID | PRICE | DATE_ID

1| 2324 | 423

2 | 52315 | 234

But I get an error in german language saying something like: “VALUES-clause must have atleast one element. Emtpy elements are not allowed”

“VALUES-Klausel muss mindestens ein Element enthalten. Leere Elemente sind nicht zulässig.”

Thank you so much! Flippi

Advertisement

Answer

I think you want INSERT . . . SELECT:

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement