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

Method SetStmtAttr

cpp/src/arrow/flight/sql/odbc/odbc_impl/odbc_statement.cc:554–714  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

552}
553
554void ODBCStatement::SetStmtAttr(SQLINTEGER statement_attribute, SQLPOINTER value,
555 SQLINTEGER buffer_size, bool is_unicode) {
556 size_t attribute_to_write = 0;
557 bool successfully_written = false;
558
559 switch (statement_attribute) {
560 case SQL_ATTR_APP_PARAM_DESC: {
561 ODBCDescriptor* desc = static_cast<ODBCDescriptor*>(value);
562 if (desc && current_apd_ != desc) {
563 if (current_apd_ != built_in_apd_.get()) {
564 current_apd_->DetachFromStatement(this, true);
565 }
566 current_apd_ = desc;
567 if (current_apd_ != built_in_apd_.get()) {
568 desc->RegisterToStatement(this, true);
569 }
570 }
571 return;
572 }
573 case SQL_ATTR_APP_ROW_DESC: {
574 ODBCDescriptor* desc = static_cast<ODBCDescriptor*>(value);
575 if (desc && current_ard_ != desc) {
576 if (current_ard_ != built_in_ard_.get()) {
577 current_ard_->DetachFromStatement(this, false);
578 }
579 current_ard_ = desc;
580 if (current_ard_ != built_in_ard_.get()) {
581 desc->RegisterToStatement(this, false);
582 }
583 }
584 return;
585 }
586 case SQL_ATTR_IMP_PARAM_DESC:
587 throw DriverException("Cannot assign implementation descriptor.", "HY017");
588 case SQL_ATTR_IMP_ROW_DESC:
589 throw DriverException("Cannot assign implementation descriptor.", "HY017");
590 // Attributes that are descriptor fields
591 case SQL_ATTR_PARAM_BIND_OFFSET_PTR:
592 current_apd_->SetHeaderField(SQL_DESC_BIND_OFFSET_PTR, value, buffer_size);
593 return;
594 case SQL_ATTR_PARAM_BIND_TYPE:
595 current_apd_->SetHeaderField(SQL_DESC_BIND_TYPE, value, buffer_size);
596 return;
597 case SQL_ATTR_PARAM_OPERATION_PTR:
598 current_apd_->SetHeaderField(SQL_DESC_ARRAY_STATUS_PTR, value, buffer_size);
599 return;
600 case SQL_ATTR_PARAM_STATUS_PTR:
601 ipd_->SetHeaderField(SQL_DESC_ARRAY_STATUS_PTR, value, buffer_size);
602 return;
603 case SQL_ATTR_PARAMS_PROCESSED_PTR:
604 ipd_->SetHeaderField(SQL_DESC_ROWS_PROCESSED_PTR, value, buffer_size);
605 return;
606 case SQL_ATTR_PARAMSET_SIZE:
607 current_apd_->SetHeaderField(SQL_DESC_ARRAY_SIZE, value, buffer_size);
608 return;
609 case SQL_ATTR_ROW_ARRAY_SIZE:
610 current_ard_->SetHeaderField(SQL_DESC_ARRAY_SIZE, value, buffer_size);
611 return;

Callers 2

SQLSetStmtAttrFunction · 0.80
SetConnectAttrMethod · 0.80

Calls 10

DriverExceptionClass · 0.85
SetAttributeFunction · 0.85
to_stringFunction · 0.85
DetachFromStatementMethod · 0.80
RegisterToStatementMethod · 0.80
SetHeaderFieldMethod · 0.80
AddWarningMethod · 0.80
getMethod · 0.45
SetAttributeMethod · 0.45

Tested by

no test coverage detected