Leerzeichen in SQL-Abfragen ergänzt
This commit is contained in:
parent
c04932383e
commit
2b119f6752
@ -69,18 +69,18 @@ func Open(dbName string) (*DB, error) {
|
|||||||
func (db *DB) WriteBriefing(b *types.Briefing) error {
|
func (db *DB) WriteBriefing(b *types.Briefing) error {
|
||||||
for i := 0; i < len(b.Participants); i++ {
|
for i := 0; i < len(b.Participants); i++ {
|
||||||
result, err := db.Exec("INSERT INTO "+db.Name+" (instructor_first,"+
|
result, err := db.Exec("INSERT INTO "+db.Name+" (instructor_first,"+
|
||||||
"instructor_last, date, time, state, location, participant_first,"+
|
" instructor_last, date, time, state, location, participant_first,"+
|
||||||
"participant_last, company) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)",
|
" participant_last, company) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)",
|
||||||
b.FirstName, b.LastName, b.Date, b.Time, b.State, b.Location,
|
b.FirstName, b.LastName, b.Date, b.Time, b.State, b.Location,
|
||||||
b.Participants[i].FirstName, b.Participants[i].LastName,
|
b.Participants[i].FirstName, b.Participants[i].LastName,
|
||||||
b.Participants[i].Company)
|
b.Participants[i].Company)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("*DB.WriteBriefing: db.Exec(\"INSERT INTO"+
|
return fmt.Errorf("*DB.WriteBriefing: db.Exec(\"INSERT INTO"+
|
||||||
"\"+db.Name+\" (instructor_first, instructor_last, date, time, state,"+
|
" \"+db.Name+\" (instructor_first, instructor_last, date, time, state,"+
|
||||||
"location, participant_first, participant_last, company) VALUES (?, ?,"+
|
" location, participant_first, participant_last, company) VALUES (?, ?,"+
|
||||||
"?, ?, ?, ?, ?, ?, ?)\", b.FirstName, b.LastName, b.Date, b.Time,"+
|
" ?, ?, ?, ?, ?, ?, ?)\", b.FirstName, b.LastName, b.Date, b.Time,"+
|
||||||
"b.State, b.Location, b.Participants[i].FirstName,"+
|
" b.State, b.Location, b.Participants[i].FirstName,"+
|
||||||
"b.Participants[i].LastName, b.Participants[i].Company): %v\n", err)
|
" b.Participants[i].LastName, b.Participants[i].Company): %v\n", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err = result.LastInsertId()
|
_, err = result.LastInsertId()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user