MCPcopy Create free account
hub / github.com/apache/arrow / SQLPrepare

Function SQLPrepare

cpp/src/arrow/flight/sql/odbc/odbc_api.cc:1056–1071  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1054}
1055
1056SQLRETURN SQLPrepare(SQLHSTMT stmt, SQLWCHAR* query_text, SQLINTEGER text_length) {
1057 ARROW_LOG(DEBUG) << "SQLPrepareW called with stmt: " << stmt
1058 << ", query_text: " << static_cast<const void*>(query_text)
1059 << ", text_length: " << text_length;
1060
1061 using ODBC::ODBCStatement;
1062 // The driver is built to handle SELECT statements only.
1063 return ODBCStatement::ExecuteWithDiagnostics(stmt, SQL_ERROR, [=]() {
1064 ODBCStatement* statement = reinterpret_cast<ODBCStatement*>(stmt);
1065 std::string query = ODBC::SqlWcharToString(query_text, text_length);
1066
1067 statement->Prepare(query);
1068
1069 return SQL_SUCCESS;
1070 });
1071}
1072
1073SQLRETURN SQLExecute(SQLHSTMT stmt) {
1074 ARROW_LOG(DEBUG) << "SQLExecute called with stmt: " << stmt;

Callers 1

TYPED_TESTFunction · 0.50

Calls 2

SqlWcharToStringFunction · 0.85
PrepareMethod · 0.45

Tested by 1

TYPED_TESTFunction · 0.40