Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 15. IBM Informix > Other Data Types

Other Data Types

The additional IBM Informix data types are not explicitly supported by PowerBuilder; however, some of them can be used in certain scenarios within the development or runtime environment. Specific details on these data types follow.

  • Boolean—TRUE/FALSE— Values are interpreted as CHAR(1) data in PowerBuilder and can be selected within DataWindows and embedded SQL. If the value of the DisableBind DBParm is set to 1, boolean fields can also be updated via PowerBuilder.

  • LVARCHAR— You can select these variable length character strings into a PowerBuilder DataWindow as a CHAR(2048) column or into a string via embedded SQL as shown in Listing 15.4.

    Listing 15.4. Retrieving the Contents of an LVARCHAR Column

    string  ls_desc
    integer li_length
    // retrieve item_desc LVARCHAR column
    // and its length given a catalog_num
    DECLARE c CURSOR FOR SELECT
      CAST(item_desc as CHAR(2048)),
      LENGTH(item_desc)
      FROM catalog
      WHERE catalog_num = :al_catnum;
    OPEN c;
    IF SQLCA.SQLCODE = 1 THEN
      FETCH c into :ls_desc, :li_length;
      // since item_desc was cast to CHAR(2048) we need
      // to trim off the 'extra' characters that were not
      // stored with the original column value
      ls_desc = Left(ls_desc, li_length)
      CLOSE c;
    END IF

    LVARCHAR columns can be updated via embedded SQL or DataWindows as well. When using embedded SQL, keep in mind that because IBM Informix limits string literals to 255 characters, the PowerBuilder DisableBind DBParm cannot be set to 1 when updating LVARCHAR data types.

  • INT8 and SERIAL8 are 64-bit versions of the INT and SERIAL types, respectively. Although PowerBuilder includes a longlong data type of 64-bits, these large values are not supported by the PowerBuilder database interfaces or by the DataStore and DataWindow functions.

  • CLOB and BLOB are considered “smart” analogs of the TEXT and BYTE data types that are recoverable, can support up to 4TB of data, and can be retrieved in whole or part. Because you cannot cast CLOB or BLOB to TEXT or BYTE, these data types are not currently supported in PowerBuilder.

  • Opaque data types are encapsulated data types defined using the IBM Informix SQL statement CREATE OPAQUE TYPE. Using the CREATE CAST statement, you can define functions that can translate an opaque data type into a supported data type and retrieve the resulting data into PowerBuilder.

  • Distinct data types, defined using CREATE DISTINCT TYPE, are translated to CHAR(n) data types when retrieved by PowerBuilder, where n is the number of bytes required to store the value. For character-based data, this will generally work well; however, for numeric data, the value should be cast into a supported data type before returning that data to PowerBuilder.

  • Row types, defined using CREATE ROW TYPE, are not supported; however, if the individual fields within a ROW TYPE are supported data types, they can be selected explicitly via dot notation in embedded SQL or by appropriately coding the SELECT statement in the syntax view of the DataWindow painter. IBM Informix does not allow an update of ROW TYPES with dot-notated syntax, however.

  • Collection data types include LIST, SET, and MULTISET, and they are not supported in PowerBuilder.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint