Za każdym razem, gdy próbuję utworzyć instrukcję wstawiania do mojej bazy danych, otrzymuję komunikat "Niepoprawna wartość dziesiętna:" NULL "dla kolumny" bounty3 "w wierszu 1". Jak wstawić wartość pustą do dziesiętnego typu danych? Czy powinienem po prostu ustawić wartość domyślną 0.00?MySQL - Decimal nie może być NULL
Incorrect decimal value: '' for column 'bounty3' at row 1 Whole query: INSERT INTO songs (userid, wavURL, mp3URL, genre, songTitle, BPM, insWanted, bounty, insWanted2, bounty2, insWanted3, bounty3, insWanted4, bounty4, insWanted5, bounty5, insWanted6, bounty6, insWanted7, bounty7, insWanted8, bounty8, insWanted9, bounty9, insWanted10, bounty10) VALUES ('12534545', '/audio/wav/jqmrgpfcMichael/135259578210secreason.wav', '/audio/mp3/jqmrgpfcMichael/135259578210secreason.mp3', 'Rock/Funk', 'titlee', '120', 'bass', '20.00', 'guitar', '20.00', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '')
Próbowałem tego oświadczenia z wartości NULL też. Oto błąd:
Incorrect decimal value: 'NULL' for column 'bounty3' at row 1 Whole query: INSERT INTO songs (userid, wavURL, mp3URL, genre, songTitle, BPM, insWanted, bounty, insWanted2, bounty2, insWanted3, bounty3, insWanted4, bounty4, insWanted5, bounty5, insWanted6, bounty6, insWanted7, bounty7, insWanted8, bounty8, insWanted9, bounty9, insWanted10, bounty10) VALUES ('12534545', '/audio/wav/jqmrgpfcMichael/143922765110secreason.wav', '/audio/mp3/jqmrgpfcMichael/143922765110secreason.mp3', 'Rock/Funk', 'title', '110', 'bass', '110.00', 'guitar', '20.00', 'NULL', 'NULL', 'NULL', 'NULL', 'NULL', 'NULL', 'NULL', 'NULL', 'NULL', 'NULL', 'NULL', 'NULL', 'NULL', 'NULL', 'NULL', 'NULL')
Czy możesz podać wkleić instrukcję code/mysql, która wstawia dane. –
Upewnij się, że definicja tabeli dopuszcza wartości NULL dla tej kolumny. Jeśli to nie pomoże nam pokazać kod i definicję danych. – Eelke
Zaktualizowałem za pomocą mojej instrukcji wstawiania. Usunąłem wartość "NULL" i teraz otrzymuję ten błąd. – user547794