Highlighted
Super Contributor.
Super Contributor.
506 views

Are Host Arrays supported in OpenESQL ADO .NET managed code?

Jump to solution
We want to improve the speed at which one of our programs can INSERT rows into a table. Host Arrays sounds like the way to go, but the documentation (.NET Host Variables in Managed Code) specifies that .NET Host Variables must be declared at the Record (01) level? Can we do "01 EMP-EMPNO OCCURS 25 TIMES STRING." in a EXEC SQL BEGIN DECLARE SECTION?
0 Likes
1 Solution

Accepted Solutions
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: Are Host Arrays supported in OpenESQL ADO .NET managed code?

Jump to solution

Yes this is supported. I just tested here with the following. The array must have a size and cannot just specify occurs any as this causes an error. BTW, EXEC SQL BEGIN DECLARE is not required when using OpenESQL.

 

 

       01 company-name-str  string occurs 5.
       01 company-contact-str string occurs 5.
       01 row-num pic s9(9) comp-5 value 5.

       procedure division.
           EXEC SQL 
              CONNECT TO 'SQLADO32WA' 
           END-EXEC 
          
           EXEC SQL 
              for :row-num
              SELECT 
                 A.CompanyName
                ,A.ContactName
              INTO 
                 :company-name-str
                ,:company-contact-str
              FROM dbo.Customers A
           END-EXEC 
           goback.

View solution in original post

0 Likes
1 Reply
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: Are Host Arrays supported in OpenESQL ADO .NET managed code?

Jump to solution

Yes this is supported. I just tested here with the following. The array must have a size and cannot just specify occurs any as this causes an error. BTW, EXEC SQL BEGIN DECLARE is not required when using OpenESQL.

 

 

       01 company-name-str  string occurs 5.
       01 company-contact-str string occurs 5.
       01 row-num pic s9(9) comp-5 value 5.

       procedure division.
           EXEC SQL 
              CONNECT TO 'SQLADO32WA' 
           END-EXEC 
          
           EXEC SQL 
              for :row-num
              SELECT 
                 A.CompanyName
                ,A.ContactName
              INTO 
                 :company-name-str
                ,:company-contact-str
              FROM dbo.Customers A
           END-EXEC 
           goback.

View solution in original post

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.