Function documentationgetDescription Method (SapDB_ResultSet Class) Locate this document in the navigation structure

 

getDescription is a method of the SapDB_ResultSet class (sdb.sql module). You can use this method to display information about the columns in the result set.

Features

Syntax Syntax

  1. getDescription ()
End of the code.
Result

The following properties of the columns are returned:

  • Name

  • Type (as a string)

  • Type (as an integer according to the ODBC specification)

  • Logical size (maximum number of characters in string columns, maximum number of numbers in numerical columns)

  • Number of decimal places

  • Indicator that specifies whether the column can be NULL

  • The value in the in/out column is always OUT for this method (result set).

Example

With the sql method, you execute an SQL statement that returns a result set. With the getDescription method, you display information about the columns of this result set.

Syntax Syntax

  1. cursor = session.sql ("SELECT * FROM hotel.customer")
    print "colname    type    code    length    frac    null?    in/out"
    print "============================================================"
      for columnDescription in cursor.getDescription ():
    print "%-10s %-10s %4d %6d %2d %5s %s" %
    columnDescription
    
End of the code.
Result

colname type code length frac null? in/out

============================================================

CNO Fixed 3 4 0 None OUT

TITLE Char 1 7 0 1 OUT

FIRSTNAME Char 1 20 0 1 OUT

NAME Char 1 20 0 None OUT

ZIP Char 1 5 0 1 OUT

ADDRESS Char 1 40 0 None OUT