Пример #1
0
//Terminates a connection to a data source.
func SqlDisConnect(conn *odbc.Connection) {

	zr, ok := GStatementPerConnection[conn]
	if ok {
		for _, zstmt := range zr {
			zstmt.Close()
		}
	} else {
		panic("Connection is invalid")
	}

	conn.Close()
}
Пример #2
0
//Prepares a SQL statement for remote execution by SQLEXEC( ).
func SqlPrepare(zconn *odbc.Connection, zselect string, zcursor string) (*odbc.Statement, *odbc.ODBCError) {
	zstmt, zerr := zconn.Prepare(zselect)
	GPrepareMapCursor[zstmt] = zcursor
	GStatementPerConnection[zconn] = append(GStatementPerConnection[zconn], zstmt)
	return zstmt, zerr
}