Subject | Re: [ib-support] Longevity of firebird / Interbase |
---|---|
Author | Jaume Andreu Sabater Malondra |
Post date | 2002-09-04T09:48:11Z |
On Wednesday 04 September 2002 11:40, lester@... wrote:
SELECT fields. I mean, something like this:
CREATE PROCEDURE GET_NEWS (
P_FIRST INTEGER,
P_SKIP INTEGER)
RETURNS (
P_CREDAT TIMESTAMP,
P_NEWTIT VARCHAR(50),
P_NEWBDY BLOB) AS
BEGIN
FOR
SELECT FIRST :P_FIRST SKIP :P_SKIP
NEW_CREDAT, NEW_NEWTIT, NEW_NEWBDY
FROM NEWS
ORDERY BY NEW_CREDAT DESC
INTO :P_CREDAT, :P_NEWTIT, :P_NEWBDY
DO
SUSPEND;
END
Someone gave me a solution in this list about a month ago or so, which is
stored in my Firebird folder in my Kmail ;-) but that time I preferred to
include the SELECT statement into the Php code due to other aspects.
The thing is that I try to never put the SELECT statement in my Php code when
programming web sites. Instead of that, I always try to maintain all the
logic of the database into the database in form of stored procedures and
triggers (splitting logic from data and also keeping the database more secure
in terms of data integrity and intrusion avoidance).
The user used from the Php code has only the minimum permissions to execute
the stored procedures it needs to send and retreive the information that
passes through the web pages (but never permissions over the tables
themselves). This is one of the main reasons why I love Firebird: it is a
full, "ANSI compliant" relational database. And that's the main reason why I
don't like MySQL :-D
--
Jaume Andreu Sabater Malondra
jsabater@...
Registered linux user #209072
"Ubi sapientas ibi libertas"
> I ask again, what else do you need from Firebird?I would like to be able to use input parameters in a stored procedure as
SELECT fields. I mean, something like this:
CREATE PROCEDURE GET_NEWS (
P_FIRST INTEGER,
P_SKIP INTEGER)
RETURNS (
P_CREDAT TIMESTAMP,
P_NEWTIT VARCHAR(50),
P_NEWBDY BLOB) AS
BEGIN
FOR
SELECT FIRST :P_FIRST SKIP :P_SKIP
NEW_CREDAT, NEW_NEWTIT, NEW_NEWBDY
FROM NEWS
ORDERY BY NEW_CREDAT DESC
INTO :P_CREDAT, :P_NEWTIT, :P_NEWBDY
DO
SUSPEND;
END
Someone gave me a solution in this list about a month ago or so, which is
stored in my Firebird folder in my Kmail ;-) but that time I preferred to
include the SELECT statement into the Php code due to other aspects.
The thing is that I try to never put the SELECT statement in my Php code when
programming web sites. Instead of that, I always try to maintain all the
logic of the database into the database in form of stored procedures and
triggers (splitting logic from data and also keeping the database more secure
in terms of data integrity and intrusion avoidance).
The user used from the Php code has only the minimum permissions to execute
the stored procedures it needs to send and retreive the information that
passes through the web pages (but never permissions over the tables
themselves). This is one of the main reasons why I love Firebird: it is a
full, "ANSI compliant" relational database. And that's the main reason why I
don't like MySQL :-D
--
Jaume Andreu Sabater Malondra
jsabater@...
Registered linux user #209072
"Ubi sapientas ibi libertas"