Golang database/sql.DB.Exec function example
package database/sql
Exec executes a query without returning any rows. The args are for any placeholder parameters in the query.
Golang database/sql.DB.Exec function usage example
db, err := sql.Open("mysql", dbURL)
if err != nil {
t.Fatalf("Error connecting: %s", err.Error())
}
defer db.Close()
db.Exec("DROP TABLE IF EXISTS dummy") // <-- here
Reference :
Advertisement
Something interesting
Tutorials
+4.8k Golang : A program that contain another program and executes it during run-time
+8.4k Golang : Ackermann function example
+14k Golang : convert rune to unicode hexadecimal value and back to rune character
+5.6k Python : Print unicode escape characters and string
+30.9k Golang : Interpolating or substituting variables in string examples
+9.1k Golang : Serving HTTP and Websocket from different ports in a program example
+16.5k Golang : Execute terminal command to remote machine example
+9.9k Golang : Function wrapper that takes arguments and return result example
+6.9k Mac/Linux/Windows : Get CPU information from command line
+13.4k Golang : Increment string example
+11.6k Golang : Concurrency and goroutine example
+31.7k Golang : How to convert(cast) string to IP address?