IBM Books

Net.Data Language Environment Reference


Oracle Language Environment

The Oracle language environment provides native access to your Oracle data. You can access Oracle tables from Net.Data running in CGI, FastCGI, NSAPI, ISAPI, or GWAPI mode. This language environment supports Oracle 7.2, 7.3, and 8.0.

Restrictions:

To access Oracle from Net.Data

  1. Verify that the ENVIRONMENT statement in the Net.Data initialization file is correct for the Oracle language environment. See the configuration chapter in Net.Data Administration and Programming Guide for steps and examples.

  2. Ensure the appropriate components of Oracle are installed and working as follows:

    1. Install SQL*Net on the machine where Net.Data is installed, if it is not already installed. For more information, see the following URL:
      http://www.oracle.com/products/networking/html/stnd_sqlnet.html
      

    2. Verify that the Oracle tnsping function can be used with the same security authorization that your Web server uses. To verify, log on with your Web server's user ID and type:
      tnsping oracle-instance-name
      

      Where oracle-instance-name is the name of the Oracle system that your Net.Data macros access.

      You might not be able to verify the tnsping function on Windows NT if your Web server runs under system authority. If so, skip this step.

    3. Verify that the Oracle tables can be accessed with the same security authorization that your Web server uses. To verify, enter an SQL SELECT statement, using the SQL*Plus line command tool, to access an Oracle table with an SQL SELECT statement with the authority of your Web server. For example:
      SELECT * FROM tablename
      

      You might not be able to verify table access on Windows NT if your Web server runs under system authority. If so, skip this step.

    Troubleshooting: Do not proceed if the above steps fail. If any of the steps fail, check your Oracle configuration.

  3. Ensure that the Oracle environment variables are set correctly in your Web server process. Hint: You might require additional lines for other Oracle environment variables, depending on the Oracle facilities you plan to use, such as national language support and two phase commit. Consult the Oracle administration documentation for more information on these environment variables.

  4. Test the connection to Oracle from Net.Data. In your Net.Data macro file, specify the appropriate values in the LOGIN and PASSWORD variables. Do not define the DATABASE variable when accessing Oracle databases. The following is an example of connect statement in a macro file:
    %DEFINE LOGIN=user_ID@remote-oracle-instance-name
    %DEFINE PASSWORD=password 
    

    Local Oracle instances:

    If you access the local Oracle instance only, do not specify the remote-oracle-instance name as part of the login user ID, as in the following example:

    %DEFINE LOGIN=user_ID
    %DEFINE PASSWORD=password
    
    Live Connection:

    If you use Live Connection, then you can specify the LOGIN and PASSWORD in the Live Connection configuration file, although it is not recommended for security purposes. For example:

    LOGIN=user_ID
    PASSWORD=password
    
    Hint: Do not specify the DATABASE variable for Oracle.

  5. Test your configuration by running a CGI shell script to ensure that the Oracle instance can be accessed from your Web server, as in the following example:
    #! /bin/sh
    echo "content-type; text/html
    echo
    echo "< html>< pre>"
    set
    echo "</pre>< p>< pre>"
    tnsping oracle-instance-name
    echo
    

    Alternatively, you can execute tnsping directly from a Net.Data macro, as in the following example:

    %DEFINE testora = %exec "tnsping oracle-instance-name"
    %HTML (report){
    < P>About to test Oracle access with tnsping.
    < hr>
    $(testora)
    < hr>
    < P>The Oracle test is complete.
    %}
    

    Troubleshooting:

    If the verification step fails, check that all the preceding steps were successful by verifying the following items:

Example:

After you have completed the accessing verification steps, you can make calls to the Oracle language environment with functions in the macro file, as in the following example:

%FUNCTION(DTW_ORA) STL1() {
insert into $(tablename) (int1,int2) values (111,NULL)
%}


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]