Use the following steps to access Oracle databases from a Net.Data macro:
http://www.oracle.com/products/networking/html/stnd_sqlnet.html
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.
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.
ORACLE_SID=oracle-instance-name ORACLE_HOME=oracle-runtime-library-directory
ORACLE_SID=oracle-instance-name ORACLE_HOME=oracle-runtime-library-directory
%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=passwordLive 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:
CLIETTE DTW_ORA:{ MIN_PROCESS=1 MAX_PROCESS=3 EXEC_NAME=./dtwora8 DATABASE=not_used LOGIN=userid@remote_oracle_instance_name PASSWORD=password }Hint: Do not specify the DATABASE variable for Oracle.
#! /bin/sh echo "content-type; text/html echo echo "<html><pre>" set echo "</pre><p> </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, as in the following example:
%FUNCTION(DTW_ORA) STL1() { insert into $(tablename) (int1,int2) values (111,NULL) %}