Highlighted
Absent Member.
Absent Member.
900 views

OpenESQL Assistant with ADO.NET

Jump to solution

Hi,

Could anybody please help me in automating this task using the OpenESQL Assistant for ADO.NET mode, since I have to rewrite the same code every time with slight changes such a cursor name and the query of course

      

    exec sql declare all_accounts_cursor dataset cursor for

      

        select * from account

      

    end-exec.

      

   

      

    exec sql

      

        open all_accounts_cursor

      

    end-exec.

      

   

      

    exec ado get cursor all_accounts_cursor into :accounts-dataset

      

        rename datatable as account_table

      

    end-exec.

      

   

      

    set result-set to accounts-dataset::Copy.

      

   

      

    exec sql

      

        close all_accounts_cursor

      

    end-exec.

Tags (2)
0 Likes
1 Solution

Accepted Solutions
Micro Focus Expert
Micro Focus Expert

Hi Ahmet,

The OpenESQL Assistant can be used for automating the code generation for some of the commonly used tasks but it does not support every possible code scenario.

The scenario that you present here, where you are using a mixture of EXEC SQL and EXEC ADO statements is one of those scenarios that are not supported.

You can generate the EXEC SQL cursor through the OpenESQL Assistant but then your would manuallly have to add the code to get the cursor into a dataset.

An alternative to using the EXEC SQL would be to generate the statements as EXEC ADO connected model statements entirely which also allows you to read the rows from a database connection and then create a dataset from it. although I also find it easier to use the combination of EXEC SQL and EXEC ADO GET CURSOR INTO statements.

Thanks..

View solution in original post

0 Likes
1 Reply
Micro Focus Expert
Micro Focus Expert

Hi Ahmet,

The OpenESQL Assistant can be used for automating the code generation for some of the commonly used tasks but it does not support every possible code scenario.

The scenario that you present here, where you are using a mixture of EXEC SQL and EXEC ADO statements is one of those scenarios that are not supported.

You can generate the EXEC SQL cursor through the OpenESQL Assistant but then your would manuallly have to add the code to get the cursor into a dataset.

An alternative to using the EXEC SQL would be to generate the statements as EXEC ADO connected model statements entirely which also allows you to read the rows from a database connection and then create a dataset from it. although I also find it easier to use the combination of EXEC SQL and EXEC ADO GET CURSOR INTO statements.

Thanks..

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.