4 Replies Latest reply on Dec 21, 2012 7:11 AM by BowdenData

    Need help access FileMaker Pro 12 Data on Windows 7 using ActivePerl

    spearson

      All

       

      I am new to FileMaker and need assistance with accessing data using a Perl script. I have created a test database (called sptest) with 1 tabe (called Names) that has 4 fields (First, Last, Address1 and Status) There are 3 records in the table. As far as I can tell the following script *should* select the data.

       

      #!perl

      use DBI;

      #####################

      # Open the database #

      #####################

      my $dbh=DBI->connect("dbi:ODBC:sptest", "sp", "sp", {RaiseError => 1, PrintError => 1, AutoCommit => 1})

      or die "Failed connecting to the database.";

      #######################

      # Check valid drivers #

      #######################

      my @drivers = DBI->available_drivers;

      print "Drivers = ", join(", ", @drivers), " ";

      ###########################

      # Select from Names Table #

      ###########################

      print "1 ";

      my $sth=$dbh->prepare("SELECT Last FROM Names");

      print "2 ";

      $sth->execute();

      print "3 ";

      ######################

      # Close the Database #

      ######################

      $sth->finish();

      $dbh->disconnect();

       

       

      It appears to open the database and can determine which drivers are valid. The problem appears to be on the syntax of the highlighted select clause. The output from the script is shown below.

       

      C: emp>set_event.pl

      Drivers = CSV, DBM, ExampleP, File, Gofer, ODBC, Oracle, Pg, Proxy, SQLite, Sponge

      1

      DBD::ODBC::db prepare failed: [FileMaker][FileMaker] FQL0001/(1:8): There is an error in the syntax of the query. (SQL-42000) at C: empset_event.pl line 24.

      DBD::ODBC::db prepare failed: [FileMaker][FileMaker] FQL0001/(1:8): There is an error in the syntax of the query. (SQL-42000) at C: empset_event.pl line 24.

       

      I would appreciate if someone could point me at what I am doing wrong and what I need to do to correct it.

       

      Thank you in advance for your assistance

      Stephen