On Tue, 24 Jun 2003 12:41:43 -0400 "Chang, Mei" <[EMAIL PROTECTED]> wrote:
> My program successfully connected to oracle DB and performed all sql > statements, but if I uses perl.exe -w then I got the following > warnings. (Note: the script is still working and executes the sql > statements successfully). Can some one tell me how can I get rid > of this warnings. What does this error mean? It means that you are using a variable before giving it a value. > connecting to Oralce.... Use of uninitialized value in concatenation > <.> or string at C:\perl5.6.1.633\site\lib\DBD\Oracle.pm line 192 The error is occuring at line 192 in DBD/Oracle.pm. Look in that file to see what is happening. I am not sure what exact version you are using, so I can't be sure what is happening. > The following is the subroutine for connect_db > > sub connect_db() > { > my $dbh1; > my $db = 'ORA'; #should it be oracle? > my $hostname = 'host=test01'; > #my $port = 'port=1521'; > my $sid = 'sid=ORA'; > my $user = 'abc'; # fake username... use your own > my $password = 'abcabc'; # fake password... use your own > my $dsn = "dbi:Oracle:$db;$hostname;$sid;$user;$password;"; Remove ';$user;$password', they don't belong in the DSN. All parts after ';' are supposed to be key=value pairs and you give the userid and password as separate arguments anyway. Look in http://search.cpan.org/dist/DBD-Oracle/Oracle.pm for the correct syntax for the DSN argument for DBD::Oracle. If the instance is named in tnsnames.ora or Oracle*Names, you don't have to use the host=;sid= syntax. -- Mac :}) Give a hobbit a fish and he eats fish for a day. Give a hobbit a ring and he eats fish for an age.