0

次のようなテーブルを作成するSQLクエリがあります。

 db.execute ("CREATE TABLE IF NOT EXISTS RATING (programCode INTEGER , fromDate INTEGER, 
 toDate INTEGER, programName TEXT, channelName TEXT, weekday TEXT, startTime TEXT, 
 endTime TEXT, duration TEXT, episodeName TEXT, Ind2 DECIMAL(4,2), A18 DECIMAL(4,2), M18 
 DECIMAL(4,2), F18 DECIMAL(4,2), A18_24 DECIMAL(4,2), M18_24 DECIMAL(4,2), A18_34 
 DECIMAL(4,2), M18_34 DECIMAL(4,2), F18_34 DECIMAL(4,2), A18_49 DECIMAL(4,2), M18_49 
 DECIMAL(4,2), F18_49 DECIMAL(4,2), A25_34 DECIMAL(4,2) , M25_34 DECIMAL(4,2), A25_49 
 DECIMAL(4,2), M25_49 DECIMAL(4,2), F25_49 DECIMAL(4,2), A25_54 DECIMAL(4,2), M25_54 
 DECIMAL(4,2), F25_54 DECIMAL(4,2), A35_plus DECIMAL(4,2), M35_plus DECIMAL(4,2), 
 F35_plus DECIMAL(4,2), M35_49 DECIMAL(4,2), F35_49 DECIMAL(4,2), A35_54 DECIMAL(4,2), 
 M35_54 DECIMAL(4,2), F35_54 DECIMAL(4,2), A35_64 DECIMAL(4,2), M35_64 DECIMAL(4,2), 
 F35_64 DECIMAL(4,2), A50_plus DECIMAL(4,2), M50_plus DECIMAL(4,2), F50_plus 
 DECIMAL(4,2), C2_11 DECIMAL(4,2), T12_17 DECIMAL(4,2), V12_24 DECIMAL(4,2), PRIMARY 
 KEY(programCode,fromDate , toDate))")

ただし、テーブル データを確認すると、(10,8) を持つ 2 つのセルを除いて、すべての行と列に 10 進数値 (4,2) があります。

何が原因で、どのように修正すればよいのかわかりません!

添付画像をご覧ください

ここに画像の説明を入力


クエリを次のように変更しました。

 db.execute ("INSERT INTO RATING (programCode, fromDate, toDate, programName, channelName, weekday, startTime, endTime, duration, episodeName, 
   Ind2 , A18 , M18, F18, A18_24, M18_24, A18_34, M18_34 , F18_34, A18_49 , M18_49, F18_49, A25_34 , M25_34 , A25_49 , M25_49, F25_49 , A25_54 , 
   M25_54, F25_54, A35_plus , M35_plus , F35_plus , M35_49, F35_49 , A35_54 , M35_54 , F35_54 , A35_64 , M35_64 , F35_64 , A50_plus , M50_plus , 
   F50_plus , C2_11 , T12_17 , V12_24 ) VALUES ('#{progCode}', '#{fromD}', '#{toD}', '#{arr[0]}', '#{arr[1]}','#{arr[2]}','#{arr[3]}','#{arr[4]}','#{arr[5]}','#{arr[6]}',
   '#{arr[45].to_f.round(2)}','#{arr[46].to_f.round(2)}','#{arr[47].to_f.round(2)}','#{arr[48].to_f.round(2)}','#{arr[49].to_f.round(2)}','#{arr[50].to_f.round(2)}','#{arr[51].to_f.round(2)}','#{arr[52].to_f.round(2)}','#{arr[53].to_f.round(2)}','#{arr[54].to_f.round(2)}','#{arr[55].to_f.round(2)}',
   '#{arr[56].to_f.round(2)}','#{arr[57].to_f.round(2)}','#{arr[58].to_f.round(2)}','#{arr[59].to_f.round(2)}','#{arr[60].to_f.round(2)}','#{arr[61].to_f.round(2)}','#{arr[62].to_f.round(2)}','#{arr[63].to_f.round(2)}','#{arr[64].to_f.round(2)}','#{arr[65].to_f.round(2)}','#{arr[66].to_f.round(2)}',
  '#{arr[67].to_f.round(2)}','#{arr[68].to_f.round(2)}','#{arr[69].to_f.round(2)}','#{arr[70].to_f.round(2)}','#{arr[71].to_f.round(2)}','#{arr[72].to_f.round(2)}','#{arr[73].to_f.round(2)}','#{arr[74].to_f.round(2)}','#{arr[75].to_f.round(2)}','#{arr[76].to_f.round(2)}','#{arr[77].to_f.round(2)}',
  '#{arr[78].to_f.round(2)}','#{arr[79].to_f.round(2)}','#{arr[80].to_f.round(2)}','#{arr[81].to_f.round(2)}');")

しかし、問題はまだ残っています

4

1 に答える 1