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

Function SQLPrepare

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

Source from the content-addressed store, hash-verified

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