DBD::Yaswi - A DBI interface to SWI-Prolog


DBD-Yaswi documentation  | view source Contained in the DBD-Yaswi distribution.

Index


NAME

Top

DBD::Yaswi - A DBI interface to SWI-Prolog

SYNOPSYS

Top

  use DBI;
  my $db=DBI->connect('dbi:Yaswi:user');
  my $sth=$db->prepare('find [X, Y] where Z=[1,2,3,4,5], \
		        member(X,Z), member(Y,Z), X>Y');
  $sth->execute;
  while(my @r=$sth->fetchrow_array) {
      printf "X=%_ Y=%_\n", @r;
  }

  my $sth1=$db->prepare('find [X,Y] where Z=(?),\
		         member(X, Z), member(Y, Z), \
		         X>Y, \+ member(Y, (?))');
  $sth1->execute([1..100],
		 [map{int(100*rand)}1..30]);
   while(my @r=$sth->fetchrow_array) {
       printf "X=%_ Y=%_\n", @r;
  }

  $sth2=$db->prepare('insert foo(?)');
  foreach (qw(foo bar doo moz goo too)) {
      $sth2->execute($_);
  }




AUTHOR

Top

Salvador Fandiņo, <sfandino@yahoo.com>

COPYRIGHT AND LICENSE

Top


DBD-Yaswi documentation  | view source Contained in the DBD-Yaswi distribution.