Subject | Parametrize N and M on FIRST N SKIP M inside a stored procedure |
---|---|
Author | Jaume Andreu Sabater Malondra |
Post date | 2002-08-13T09:20:55Z |
Hi everyone! I have the following problem:
I have a stored procedure which retrieves news from table NEWS. This procedure
is called from a Php script. I want it to give me FIRST N SKIP M rows, but I
need to pass those N and M values as input parameters to the stored
procedure. I have tried something like this:
SELECT FIRST :P_FIRST SKIP :P_SKIP *
FROM NEWS
WHERE [..]
But I get a token unknown error. What's wrong? Can't I parametrize SELECT
fields? I mean, those values (:P_FIRST and :P_SKIP) will change as user click
the link labeled "Older news", so they will be usually N = 5 and M a multiple
of 5, but I could change that value depending on the web design or anything.
Any hints? Thanks in advance.
--
Jaume Andreu Sabater Malondra
jsabater@...
Registered linux user #209072
"Ubi sapientas ibi libertas"
I have a stored procedure which retrieves news from table NEWS. This procedure
is called from a Php script. I want it to give me FIRST N SKIP M rows, but I
need to pass those N and M values as input parameters to the stored
procedure. I have tried something like this:
SELECT FIRST :P_FIRST SKIP :P_SKIP *
FROM NEWS
WHERE [..]
But I get a token unknown error. What's wrong? Can't I parametrize SELECT
fields? I mean, those values (:P_FIRST and :P_SKIP) will change as user click
the link labeled "Older news", so they will be usually N = 5 and M a multiple
of 5, but I could change that value depending on the web design or anything.
Any hints? Thanks in advance.
--
Jaume Andreu Sabater Malondra
jsabater@...
Registered linux user #209072
"Ubi sapientas ibi libertas"