Hi Firstly, thanks for continuing to work with me on this. Here's my script. and the output. I am able to connect to all databases in TNS_ADMIN/tnsnames.ora from the cygwin prompt, but am unable to get the script to connect. I have all the below-mentioned environment variables set in the Windows environment as well, which cygwin picks up at start-up as well. Regardless, I set them in the script as well, as shown below. I have tried all variations of the DBI->connect statement mentioned in the perldocs in the script below, but continue to encounter the OCIEnvNlsCreate error.
It seems to be a permissions issue, but I don't know where to look or how to fix it. *************************** SCRIPT ************************************* #!/usr/bin/perl use strict; use DBI; print "Testing connection to DEV \n"; $ENV{ORACLE_SID} = 'CBDEV'; $ENV{TWO_TASK} = 'CBDEV'; $ENV{TNS_ADMIN} = 'C:\oracle\product\10.2.0\client_2\NETWORK\ADMIN\tnsnam es.ora'; # Also tried replacing these with POSIX-Style paths $ENV{ORACLE_HOME} = "C:\oracle\product\10.2.0\client_2"; $ENV{NLS_LANG} = "AMERICAN_AMERICA.WE8DEC"; $ENV{ORA_NLS} = $ENV{ORACLE_HOME}."/ocommon/nls/admin/data"; $ENV{LD_LIBRARY_PATH} = $ENV{ORACLE_HOME}."/lib"; $ENV{ORA_NLS10} = '/oracle/product/10.2.0/client_2/nls/data'; my @driver_names = DBI->available_drivers; foreach my $driver_name (@driver_names) { print $driver_name,"\n"; my %attr; my @data_sources = DBI->data_sources($driver_name, \%attr); foreach (@data_sources) { print "Data Source: ",$_,"\n"; if ($_ =~/CBDEV) { my $cHash = &getCytoband(); # fails with OCI Env NlsError here..... } } } sub getCytoband() { my($name, $id); my %nameHash; my $dbh = DBI->connect('DBI:Oracle:CBDEV', 'dunston', 'rocks') || die "Error ".DBI->errstr; my $sql = qq(SELECT * from GENE_NAMES); my $sth = $dbh->prepare($sql); $sth->execute(); $sth->bind_columns(\$id, \$name); while($sth->fetch()) { $name=~s/\s+//g; $id=~s/\s+//g; $nameHash{$name}=$id; print "Name : $name ", $nameHash{$name}, "\n"; } return \%nameHash; } exit; *************************** OUTPUT ************************************* DBM *****DBI:DBM:f_dir=.cpan *****DBI:DBM:f_dir=.texmf *****DBI:DBM:f_dir=acroread *****DBI:DBM:f_dir=apache-ant-1.6.5 *****DBI:DBM:f_dir=apache-ant-1.7.0-bin *****DBI:DBM:f_dir=AppName *****DBI:DBM:f_dir=autorun *****DBI:DBM:f_dir=caBIO *****DBI:DBM:f_dir=cabioApp *****DBI:DBM:f_dir=cygwin *****DBI:DBM:f_dir=dell *****DBI:DBM:f_dir=Documents and Settings *****DBI:DBM:f_dir=Downloads *****DBI:DBM:f_dir=drivers *****DBI:DBM:f_dir=httpd-2.2.8 *****DBI:DBM:f_dir=i386 *****DBI:DBM:f_dir=indexes *****DBI:DBM:f_dir=jboss-4.0.4.GA *****DBI:DBM:f_dir=jboss-4.0.5.GA *****DBI:DBM:f_dir=MSOCache *****DBI:DBM:f_dir=MyApp *****DBI:DBM:f_dir=NALCache *****DBI:DBM:f_dir=NOVELL *****DBI:DBM:f_dir=oracle *****DBI:DBM:f_dir=Perl *****DBI:DBM:f_dir=Perl-Critic-1.082 *****DBI:DBM:f_dir=Perl-Tidy-20071205 *****DBI:DBM:f_dir=Program Files *****DBI:DBM:f_dir=RECYCLER *****DBI:DBM:f_dir=ruby *****DBI:DBM:f_dir=System Volume Information *****DBI:DBM:f_dir=Tcl *****DBI:DBM:f_dir=Temp *****DBI:DBM:f_dir=WINDOWS *****DBI:DBM:f_dir=. ExampleP *****dbi:ExampleP:dir=. File *****DBI:File:f_dir=.cpan *****DBI:File:f_dir=.texmf *****DBI:File:f_dir=acroread *****DBI:File:f_dir=apache-ant-1.6.5 *****DBI:File:f_dir=apache-ant-1.7.0-bin *****DBI:File:f_dir=AppName *****DBI:File:f_dir=autorun *****DBI:File:f_dir=caBIO *****DBI:File:f_dir=cabioApp *****DBI:File:f_dir=cygwin *****DBI:File:f_dir=dell *****DBI:File:f_dir=Documents and Settings *****DBI:File:f_dir=Downloads *****DBI:File:f_dir=drivers *****DBI:File:f_dir=httpd-2.2.8 *****DBI:File:f_dir=i386 *****DBI:File:f_dir=indexes *****DBI:File:f_dir=jboss-4.0.4.GA *****DBI:File:f_dir=jboss-4.0.5.GA *****DBI:File:f_dir=MSOCache *****DBI:File:f_dir=MyApp *****DBI:File:f_dir=NALCache *****DBI:File:f_dir=NOVELL *****DBI:File:f_dir=oracle *****DBI:File:f_dir=Perl *****DBI:File:f_dir=Perl-Critic-1.082 *****DBI:File:f_dir=Perl-Tidy-20071205 *****DBI:File:f_dir=Program Files *****DBI:File:f_dir=RECYCLER *****DBI:File:f_dir=ruby *****DBI:File:f_dir=System Volume Information *****DBI:File:f_dir=Tcl *****DBI:File:f_dir=Temp *****DBI:File:f_dir=WINDOWS *****DBI:File:f_dir=. Gofer Oracle *****dbi:Oracle:CBDEV DBI connect('CBDEV','dunston',...) failed: ERROR OCIEnvNlsCreate. Check ORACLE_HOME env var, NLS settings, permissions, etc. at tmp.pl line 26 Error ERROR OCIEnvNlsCreate. Check ORACLE_HOME env var, NLS settings, permissions, etc. at tmp.pl line 26. I would greatly appreciate your help in identifying the problem, if possible!!! Thanks much! ____________________________________________________________________________________ Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/