Leerzeichen in SQL-Abfragen ergänzt

This commit is contained in:
Jason Streifling 2023-10-08 15:16:47 +02:00
parent c04932383e
commit 2b119f6752

View File

@ -69,18 +69,18 @@ func Open(dbName string) (*DB, error) {
func (db *DB) WriteBriefing(b *types.Briefing) error {
for i := 0; i < len(b.Participants); i++ {
result, err := db.Exec("INSERT INTO "+db.Name+" (instructor_first,"+
"instructor_last, date, time, state, location, participant_first,"+
"participant_last, company) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)",
" instructor_last, date, time, state, location, participant_first,"+
" participant_last, company) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)",
b.FirstName, b.LastName, b.Date, b.Time, b.State, b.Location,
b.Participants[i].FirstName, b.Participants[i].LastName,
b.Participants[i].Company)
if err != nil {
return fmt.Errorf("*DB.WriteBriefing: db.Exec(\"INSERT INTO"+
"\"+db.Name+\" (instructor_first, instructor_last, date, time, state,"+
"location, participant_first, participant_last, company) VALUES (?, ?,"+
"?, ?, ?, ?, ?, ?, ?)\", b.FirstName, b.LastName, b.Date, b.Time,"+
"b.State, b.Location, b.Participants[i].FirstName,"+
"b.Participants[i].LastName, b.Participants[i].Company): %v\n", err)
" \"+db.Name+\" (instructor_first, instructor_last, date, time, state,"+
" location, participant_first, participant_last, company) VALUES (?, ?,"+
" ?, ?, ?, ?, ?, ?, ?)\", b.FirstName, b.LastName, b.Date, b.Time,"+
" b.State, b.Location, b.Participants[i].FirstName,"+
" b.Participants[i].LastName, b.Participants[i].Company): %v\n", err)
}
_, err = result.LastInsertId()