The TOOL_RES package provides you with a means of extracting string resources from a resource file. The goal is to ease porting of PL/SQL code from one language to another by isolating all of the Textual Data in the resource file.
In addition to extracting Textual Data from existing resource files, you can use the following utilities to create resource files that contain Textual Data.
Utility | Description |
---|---|
RESPA (Windows) resparse (UNIX) |
Is a utility that generates a resource file (.RES) from a Text File (.PRN). The resulting resource file can be used with the TOOL_RES Package. |
RESPR (Windows) resprint (UNIX) |
Is a utility that converts a resource file (.RES) to a Text File (.PRN). |
To display the supported command line syntax of these utilities on your platform, run the utilities without supplying any arguments.
In Microsoft Windows, you can invoke these executables from the Explorer or File Manager to display their command line syntax. To run the executables with arguments, use Run.
Resource resource_name"
Type string"
Content
table
{
string string 1 character_count
"content of string"
}
where:
resource_name | Is a unique name that you can reference with Tool_Res.Rfread. |
character_count | Is the number of characters in the string contents. |
content of string | Is the actual string. |
Resource "hello_world"
Type "string"
Content
table
{
string string 1 12
"Hello World!"
}
Resource "goodbye_world"
Type "string"
Content
table
{
string string 1 14
"Goodbye World!"
}
is generated into the resource file HELLO.RES using the RESPA60 utility, and referenced by the following program unit:
PROCEDURE get_res IS
resfileh Tool_Res.Rfhandle;
hellor VARCHAR2(16);
goodbyer VARCHAR2(16);
BEGIN
/*Open the resource file we generated */
resfileh:=Tool_Res.Rfopen('hello.res');
/*Get the resource file strings*/
hellor:=Tool_Res.Rfread(resfileh, 'hello_world');
goodbyer:=Tool_Res.Rfread(resfileh, 'goodbye_world');
/*Close the resource file*/
Tool_Res.Rfclose(resfileh);
/*Print the resource file strings*/
Text_IO.Put_Line(hellor);
Text_IO.Put_Line(goodbyer);
END;