Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

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

by pfaut (Priest)
on Apr 25, 2003 at 21:05 UTC ( #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
Node Status?
node history
Node Type: note [id://253257]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (7)
As of 2021-03-01 10:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?