http://qs321.pair.com?node_id=253257


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