Open iamSnehalS opened 4 years ago
I am new to odbc APIs and adding SQLColumns and SQLProcedure APIs to this package "api".
I have never used SQLColumns or SQLProcedure APIs myself.
When running the go test using this API I am not able to fetch the rows returned by above APIs. ... When i debugged , api.SQLColumns returned SQL_SUCCESS. But api.SQLFETCH is returning error code. ERROR message : mssql_test.go:175: unexpected StmtCount: should=0, is=1
It is difficult to say. You error refer to some file / line number. It is impossible to say what is on that line. If you want me to debug your code, please, share it with me somehow. Git or use zip or something. Or publish it at https://play.golang.org. But it should be self contained program that I can run to see your error message. Thank you.
Why do you want to add SQLColumns and SQLProcedure APIs? What is the problem that you are trying to solve?
Alex
Hi Alex, I am new to odbc APIs and adding SQLColumns and SQLProcedure APIs to this package "api". When running the go test using this API I am not able to fetch the rows returned by above APIs.
PFB the test code :
API: func SQLColumns(statementHandle SQLHSTMT, CatalogName SQLCHAR, NameLength1 SQLSMALLINT, SchemaName SQLCHAR, NameLength2 SQLSMALLINT, TableName SQLCHAR, NameLength3 SQLSMALLINT, ColumnName SQLCHAR, NameLength4 SQLSMALLINT) (ret SQLRETURN) { r := C.SQLColumns(C.SQLHSTMT(statementHandle), (C.SQLCHAR)(CatalogName), C.SQLSMALLINT(NameLength1), (C.SQLCHAR)(SchemaName), C.SQLSMALLINT(NameLength2), (C.SQLCHAR)(TableName), C.SQLSMALLINT(NameLength3), (C.SQLCHAR)(ColumnName), C.SQLSMALLINT(NameLength4)) return SQLRETURN(r)
}
Go Test: func TestSQLColumnsAPI(t testing.T) { db, sc, err := mssqlConnect() if err != nil { t.Fatal(err) } defer closeDB(t, db, sc, sc) var out api.SQLHANDLE d := db.Driver().(Driver).h
}
columnsCheck() function: func columnsCheck(h api.SQLHDBC) (api.SQLRETURN, error) { var szSchema api.SQLCHAR var szCatalog api.SQLCHAR var szColumnName api.SQLCHAR var szTableName api.SQLCHAR var szTypeName api.SQLCHAR var szRemarks api.SQLCHAR var szColumnDefault api.SQLCHAR var szIsNullable api.SQLCHAR
}
When i debugged , api.SQLColumns returned SQL_SUCCESS. But api.SQLFETCH is returning error code. ERROR message : mssql_test.go:175: unexpected StmtCount: should=0, is=1
Can you please check the code and guide what I am missing? Thanks alot in advance.
Thanks, Snehal