<?xml version="1.0" encoding="windows-1252"?>
<node id="848077" title="Re^3: Connecting to Oracle DB using DBI from CGI script" created="2010-07-05 11:26:22" updated="2010-07-05 11:26:22">
<type id="11">
note</type>
<author id="747201">
afoken</author>
<data>
<field name="doctext">
&lt;p&gt;If you set up Oracle environment variables inside a script that loads the Oracle client libraries, you have to set up the variables &lt;b&gt;before&lt;/b&gt; the libraries are loaded:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;You can set up &lt;c&gt;%ENV&lt;/c&gt; in a &lt;c&gt;BEGIN&lt;/c&gt; block, at least before loading [mod://DBD::Oracle] implicitly via &lt;c&gt;DBI-&gt;connect()&lt;/c&gt; or explicitly, better even before loading [mod://DBI].&lt;/li&gt;
&lt;li&gt;You can wrap your script in a shell script that sets the variables before passing control to your script via &lt;c&gt;exec&lt;/c&gt;.&lt;/li&gt;
&lt;li&gt;You can add &lt;c&gt;PassEnv&lt;/c&gt; or &lt;c&gt;SetEnv&lt;/c&gt; directives to the Apache configuration.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I prefer the last way, so no script has to be modified and all scripts automatically get the right Oracle configuration.&lt;/p&gt;
&lt;p&gt;Alexander&lt;/p&gt;
&lt;div class="pmsig"&gt;&lt;div class="pmsig-747201"&gt;
--&lt;br&gt;
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
&lt;/div&gt;&lt;/div&gt;</field>
<field name="root_node">
848015</field>
<field name="parent_node">
848034</field>
</data>
</node>
