Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi Folks I am working on dbi and dbd::Oracle in perl on Windows 7 64bit. But while executing, it's fetching values from DB, but windows is throwing perl interpreter has stopped error popup. Suggestions pls.
  • Comment on Perl Interpreter Stopped Working . kernelbase.dll error

Replies are listed 'Best First'.
Re: Perl Interpreter Stopped Working . kernelbase.dll error
by marto (Cardinal) on Mar 04, 2019 at 19:38 UTC

    Which version of perl (perl -v), which version of DBI and DBD::Oracle (perl -MDBI -e 'print $DBI::VERSION' etc), which oracle client library did you build it against? Post a minimal code example which replicates your problem. How do I post a question effectively?.

      C:\Strawberry\perl\bin>perl -v This is perl 5, version 28, subversion 0 (v5.28.0) built for MSWin32-x +64-multi-t hread DBI ---------------------------------------------------------------------- +--- CPAN: Module::CoreList loaded ok (v5.20180622) (no description) T/TI/TIMB/DBI-1.642.tar.gz C:\Strawberry\perl\site\lib\DBI.pm Installed: 1.642 CPAN: 1.642 up to date DBD::Oracle ---------------------------------------------------------------------- +--- CPAN: Module::CoreList loaded ok (v5.20180622) (no description) Z/ZA/ZARQUON/DBD-Oracle-1.76.tar.gz C:\Strawberry\perl\site\lib\DBD\Oracle.pm Installed: 1.76 CPAN: 1.76 up to date The code i am using is as below #!/usr/bin/perl use DBI; use DBD::Oracle; # connect to MySQL... $driver= "Oracle"; #$dsn = "DBI:$driver:ORCL;database=XXX;host=XXX:1521"; $dsn = "DBI:$driver:sid=XXX;host=XXX"; try: $dbh = DBI->connect($dsn, "uname", "pwd"); #prepare and execute the SQL statement $sth = $dbh->prepare("SELECT column FROM table WHERE TP_ID='X'"); $sth->execute; $sth->finish(); except: print "yes"; exit;

      Discipulus added code tags March 5 2019

        SELECT column FROM is invalid because column is a reserved word in Oracle. Your code lacks:

        use strict; use warnings;

        You should get in the habit of adding this and defining your variables.

        try: $dbh = DBI->connect($dsn, "uname", "pwd"); #prepare and execute the SQL statement $sth = $dbh->prepare("SELECT column FROM table WHERE TP_ID='X'"); $sth->execute; $sth->finish(); except:

        It looks like you're mixing Python code (try:, except:) with your perl here. See DBI -> RaiseError, Try::Tiny.