CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: DBI:
Add Dynamic ROWNUM value

 



sha37
Novice

Mar 3, 2010, 1:05 PM

Post #1 of 1 (4419 views)
Add Dynamic ROWNUM value Can't Post

  

Code
  

$rowCount++;

my $sql = "SELECT *
FROM
(SELECT
id, sid, rd, cmd
FROM
abc
WHERE
(delay is null or delay < sysdate)
AND
sid = ?
ORDER BY
qcounter, priority)
WHERE
rownum < ?";

my $sth = $dbh->prepare($sql);
$sth->bind_param(1, $followerName);
$sth->bind_param(2, $rowCount);



Will this work? Is this the right way to bind the ROWNUM to get rows.

Well the result will be like this if rownum is < 2

id sid rd cmd

1 zz aa alter

result will be like this if rownum is < 3

1 zz aa alter

2 xx bb edit

I will shift the first value to get the second row and process. Basically i want to process each row at a time.

Thanks

Shamma

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives