Class: Teradata::SuccessStatus
- Inherits:
-
Object
- Object
- Teradata::SuccessStatus
- Defined in:
- lib/teradata/connection.rb
Constant Summary collapse
- ACTIVITY_ECHO =
33
Instance Attribute Summary collapse
-
#acitivity_type ⇒ Object
readonly
Returns the value of attribute acitivity_type.
-
#activity_count ⇒ Object
readonly
Returns the value of attribute activity_count.
-
#n_fields ⇒ Object
readonly
Returns the value of attribute n_fields.
-
#statement_no ⇒ Object
readonly
Returns the value of attribute statement_no.
-
#warning ⇒ Object
readonly
Returns the value of attribute warning.
-
#warning_code ⇒ Object
readonly
Returns the value of attribute warning_code.
Class Method Summary collapse
Instance Method Summary collapse
- #echo? ⇒ Boolean
- #error? ⇒ Boolean
- #error_code ⇒ Object
- #failure? ⇒ Boolean
- #info ⇒ Object
-
#initialize(stmt_no, act_cnt, warn_code, n_fields, act_type, warning) ⇒ SuccessStatus
constructor
A new instance of SuccessStatus.
- #inspect ⇒ Object
- #message ⇒ Object
- #succeeded? ⇒ Boolean
- #value ⇒ Object
- #warned? ⇒ Boolean
Constructor Details
#initialize(stmt_no, act_cnt, warn_code, n_fields, act_type, warning) ⇒ SuccessStatus
Returns a new instance of SuccessStatus.
451 452 453 454 455 456 457 458 |
# File 'lib/teradata/connection.rb', line 451 def initialize(stmt_no, act_cnt, warn_code, n_fields, act_type, warning) @statement_no = stmt_no @activity_count = act_cnt @warning_code = warn_code @num_fields = n_fields @activity_type = act_type @warning = warning end |
Instance Attribute Details
#acitivity_type ⇒ Object (readonly)
Returns the value of attribute acitivity_type.
462 463 464 |
# File 'lib/teradata/connection.rb', line 462 def acitivity_type @acitivity_type end |
#activity_count ⇒ Object (readonly)
Returns the value of attribute activity_count.
461 462 463 |
# File 'lib/teradata/connection.rb', line 461 def activity_count @activity_count end |
#n_fields ⇒ Object (readonly)
Returns the value of attribute n_fields.
463 464 465 |
# File 'lib/teradata/connection.rb', line 463 def n_fields @n_fields end |
#statement_no ⇒ Object (readonly)
Returns the value of attribute statement_no.
460 461 462 |
# File 'lib/teradata/connection.rb', line 460 def statement_no @statement_no end |
#warning ⇒ Object (readonly)
Returns the value of attribute warning.
465 466 467 |
# File 'lib/teradata/connection.rb', line 465 def warning @warning end |
#warning_code ⇒ Object (readonly)
Returns the value of attribute warning_code.
464 465 466 |
# File 'lib/teradata/connection.rb', line 464 def warning_code @warning_code end |
Class Method Details
.parse(parcel_data) ⇒ Object
445 446 447 448 449 |
# File 'lib/teradata/connection.rb', line 445 def SuccessStatus.parse(parcel_data) stmt_no, _, act_cnt, warn_code, n_fields, act_type, warn_len = parcel_data.unpack('CCLSSSS') warning = parcel_data[13, warn_len] new(stmt_no, act_cnt, warn_code, n_fields, act_type, warning) end |
Instance Method Details
#echo? ⇒ Boolean
504 505 506 |
# File 'lib/teradata/connection.rb', line 504 def echo? @activity_type == ACTIVITY_ECHO end |
#error? ⇒ Boolean
491 492 493 |
# File 'lib/teradata/connection.rb', line 491 def error? false end |
#error_code ⇒ Object
471 472 473 |
# File 'lib/teradata/connection.rb', line 471 def error_code 0 end |
#failure? ⇒ Boolean
487 488 489 |
# File 'lib/teradata/connection.rb', line 487 def failure? false end |
#info ⇒ Object
475 476 477 |
# File 'lib/teradata/connection.rb', line 475 def info nil end |
#inspect ⇒ Object
467 468 469 |
# File 'lib/teradata/connection.rb', line 467 def inspect "\#<Success \##{@statement_no} cnt=#{@activity_count}>" end |
#message ⇒ Object
479 480 481 |
# File 'lib/teradata/connection.rb', line 479 def '' end |
#succeeded? ⇒ Boolean
483 484 485 |
# File 'lib/teradata/connection.rb', line 483 def succeeded? true end |
#value ⇒ Object
495 496 |
# File 'lib/teradata/connection.rb', line 495 def value end |
#warned? ⇒ Boolean
498 499 500 |
# File 'lib/teradata/connection.rb', line 498 def warned? @warning_code != 0 end |