Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

Re^2: Perl DBI + Access bind issues

by mr_mischief (Monsignor)
on Dec 12, 2008 at 03:21 UTC ( #729835=note: print w/replies, xml ) Need Help??

in reply to Re: Perl DBI + Access bind issues
in thread Perl DBI + Access bind issues

I'm unfamiliar with what the square brackets accomplish for Access, but that's the gist of it. You don't want do though, because you don't get a statement handle back from that. You need to either use prepare, execute, and one of the fetch... methods like fetchall_arrayref or you need to use one of the selectall... methods such as selectall_hashref.

For example:

my $sth = $dbh->prepare( "select ?,? from ? where ? = ?" ); $sth->execute( '[is Active?]' ,'[is Deleted?]', '[is Deleted?]', 1 ); my $array_ref = $sth->fetchall_arrayref;

Replies are listed 'Best First'.
Re^3: Perl DBI + Access bind issues
by KurtSchwind (Chaplain) on Dec 12, 2008 at 14:13 UTC

    Right. Sorry. I know it's prepare/execute, not do. I was just giving the jist of the solution. I use DBI all the time for real databases. :)

    The square brackets are a type of quoting that Access uses because they allow freaking spaces and question marks in column and table names.

    I used to drive a Heisenbergmobile, but every time I looked at the speedometer, I got lost.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://729835]
belg4mit kicks Perl in the shins, "Unmatched ) in regex; marked by" my ass
[belg4mit]: Nothing wrong with perl -le 'print ":)" =~ /(?^u:^(\:|\:\))$) /'
[Lotus1]: belg4mit are you on a Linix server?
[belg4mit]: yes. the regular expression is generated in code from a text file. that s the regular expression that Perl blows up when it reaches it, but if I use it from the comman line it's fine

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (8)
As of 2017-04-25 16:40 GMT
Find Nodes?
    Voting Booth?
    I'm a fool:

    Results (459 votes). Check out past polls.