Hi Tim, I believe you could use this snippet to determine the current schema if DBI is connected to oracle:
select sys_context('userenv','current_schema') from dual; if you could tell me the preferred way to generate a patch file I will make an attempt at it. --Eric. On Sun, Jan 04, 2004 at 08:49:14PM +0000, Tim Bunce wrote: > The DBI doesn't define a portable way to determine the 'current schema'. > Of course there are ways to do it for Oracle but I can't remember it off-hand. > A patch to change the test to determine the current schema if $dbh->{USER} > is empty would be welcomed. > > Tim. > > p.s. Yes, $dbh->{USER} isn't part of the DBI spec and shouldn't be relied upon. > > On Fri, Jan 02, 2004 at 09:33:11AM -0500, Eric Lenio wrote: > > Hi, > > > > I have perl 5.8.2, Oracle 8.1.7, and Solaris 9. I installed DBI 1.39, then was > > testing DBD-Oracle 1.14 and it failed the tests in t/select.t which call DBI's > > primary_key routine. > > > > When I launched 'make test' with DBD-Oracle, I have set the environment var > > ORACLE_USERID=/, e.g., I have set up Oracle OS authentication (with the > > os_authen_prefix oracle init parameter) to connect to oracle so no > > username/password are necessary. > > > > So the DBI primary_key expects a schema as the 2nd arg to it, in my case this > > is a blank, and thus I think this is why the tests fail. t/select.t has this: > > > > my @pk = $dbh->primary_key(undef, $dbh->{USER}, uc $table); > > > > Upon reading the DBI docs I cannot seem to find more info on $dbh->{USER}. > > If I manually set the 2nd arg to the true oracle user then the tests pass. > > Is there a better way to do this? Should I not be using ORACLE_USERID? > > > > Thanks, > > Eric. >