Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Re: security question, mysql, limit, dbi, and placeholders

by pfaut (Priest)
on Apr 25, 2003 at 21:05 UTC ( [id://253257]=note: print w/replies, xml ) Need Help??


in reply to Re: security question, mysql, limit, dbi, and placeholders
in thread security question, mysql, limit, dbi, and placeholders

Also, PostgreSQL doesn't support placeholders for the number after the LIMIT.

Yes it does.

#!/usr/bin/perl -w use strict; use DBI; my $dbh = DBI->connect("dbi:Pg:dbname=pfau") or die "Unable to connect to db: $DBI::errstr"; $dbh->{RaiseError} = 1; my $s = $dbh->prepare("select relname from pg_class limit ? offset ?") +; my $r = $s->execute(3,10); while (my @row = $s->fetchrow_array) { print "Table: $row[0]\n"; } $s->finish; $dbh->disconnect;

Produces:

Table: pg_attrdef Table: pg_toast_17086_idx Table: pg_trigger
90% of every Perl application is already written.
dragonchild

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://253257]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (4)
As of 2024-04-19 13:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found