in reply to SQL pulling information

I often find that asking a question is a prerequisite to getting an answer.

What exactly is yours?

CU
Robartes-

Replies are listed 'Best First'.
Re: Re: SQL pulling information
by andrew (Acolyte) on Oct 16, 2002 at 21:46 UTC
    How would I use perl to search through the database and search through the bars just to find a number. And if they find a line that has it then pull information.
      Use DBI to connect to the database, and launch your SQL statement, then use split to pull apart the result so you get the individual numbers, which you can then manipulate to your heart's content:
      use strict; use DBI; my $mynumber=44; # Boilerplate connect code skipped. my $sth=$dbh->prepare("select column from table where column LIKE '%$m +ynumber%'"); $sth->execute; while (my $ref=$sth->fetchrow_arrayref) { my @numbers=split /|/, $ref->[0]; # do something with @numbers, optionally if /44/ } print "This code is untested. Beware of dragons.\n";
      Does this help you?

      CU
      Robartes-