Highlighted
Outstanding Contributor.
Outstanding Contributor.
146 views

T-SQL and *.rc

Jump to solution

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!

0 Likes
1 Solution

Accepted Solutions
Highlighted
Micro Focus Expert
Micro Focus Expert

Re: T-SQL and *.rc

Jump to solution

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:

resource.JPG

View solution in original post

0 Likes
3 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert

Re: T-SQL and *.rc

Jump to solution

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:

resource.JPG

View solution in original post

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

Re: T-SQL and *.rc

Jump to solution

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

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

Re: T-SQL and *.rc

Jump to solution

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. 

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.