Skip to main content

Hi Chris,

allow me to ask for 2 questions:

1. is it possible to use T-SQL commands between exec SQL and end-exec?
    When yes, how to make the difference between SQL code and T-SQL code

2. How must we convert the Netexpress *.RC files

I see as error Directive /R invalid or not allwed here for the *.rc files

and illegal command line (COBOL)

Thanks for your great help, allowing us to advancing in visual Cobol!

Hi Chris,

allow me to ask for 2 questions:

1. is it possible to use T-SQL commands between exec SQL and end-exec?
    When yes, how to make the difference between SQL code and T-SQL code

2. How must we convert the Netexpress *.RC files

I see as error Directive /R invalid or not allwed here for the *.rc files

and illegal command line (COBOL)

Thanks for your great help, allowing us to advancing in visual Cobol!

1.  Some TSQL commands might work directly within EXEC and END-EXEC but the best way to execute these is to use dynamic SQL where you first PREPARE and then EXECUTE your statements. Dynamic SQL statements are just passed directly through to the database so no checking is done on them by the OpenESQL preprocessor. See the docs here.

2.  Resource files (.rc) are supported in Visual Studio. They should be set for Resource Compile as an action in the Properties. How are you compiling your .rc files?

Example:


1.  Some TSQL commands might work directly within EXEC and END-EXEC but the best way to execute these is to use dynamic SQL where you first PREPARE and then EXECUTE your statements. Dynamic SQL statements are just passed directly through to the database so no checking is done on them by the OpenESQL preprocessor. See the docs here.

2.  Resource files (.rc) are supported in Visual Studio. They should be set for Resource Compile as an action in the Properties. How are you compiling your .rc files?

Example:

I personally would create a stored procedure that has the t-sql in it and use "exec call".

This avoids the potential security problems with dynamic sql.

https://www.microfocus.com/documentation/visual-cobol/VC23/EclWin/HRDBRHESQL04.html


I personally would create a stored procedure that has the t-sql in it and use "exec call".

This avoids the potential security problems with dynamic sql.

https://www.microfocus.com/documentation/visual-cobol/VC23/EclWin/HRDBRHESQL04.html

RE: The issue building the resource files - this is a bug in the current product which will be fixed in version 6.0.

As Chris pointed out, if you set the Build Action to Resource Compile manually after importing it will build correctly.