Skip to main content

.NET: ADO DECLARE DATATABLE - STRING length

  • February 15, 2013
  • 0 replies
  • 0 views

Problem:

Release 5.0 .NET:

The following statement compiles well even the STRING definition has no length specified. This form is very useful but it is not reflected in the documentation.

EXEC ADO DECLARE MYTABLE DATATABLE (

         COL1               INT16           NOT NULL,

         COL2             STRING         NOT NULL,

         COL3               INT16,

         CONSTRAINT PK_MYTABLE PRIMARY KEY(COL1))

END-EXEC.

What are the impacts on using this form?

Resolution:

Just specifying STRING results in the default .NET length of a STRING variable which is fine with EXEC ADO since the preferred host variable is an object host variable. For example:

01 MY-COL2 string.

See Microsoft's .NET 2.0 Framework Class Library to get more information about STRING classes.

The same is true for BLOB/IMAGE type data in which case you define a BYTE[] object host variable.

See Net Express ..\\Examples\\Visual Studio Integration\\LOBDEMO for example of that.

Old KB# 4380