Subject Re: [firebird-php] Re: php/stored procedure error
Author Lester Caine
ArnoldGamboa.com wrote:

>>Ac> SELECT * FROM DELETE_PROPERTY WHERE the_property_id = 12
>>^^^
>>|||not right
>>right is:
>>execute procedure DELETE_PROPERTY(12)
>
> Thanks. This worked.
>
> When I did a PHP/Firebird program some 2 years ago (yeah, long time
> ago), I remember executing stored procedures as typical select
> statements (just like the one I mentioned above). This approach that
> you gave is new to me.
>
> My question is, when do we use the typical select statement and when
> do we use the "execute procedure" approach in calling the procedure
> from PHP?

The answer to this has nothing to do with PHP. You are looking at the
way Firebird handles the SQL. Which ever way you run the code you would
get an error, as ( If I remember ) this is something that has been
tidied up in the engine.

Another point - It is useful to use the AFTER DELETE trigger for this
sort of thing, rather than direct code. The PROPERTY_STYLE table would
have an AFTER DELETE trigger which contained the DELETE FROM
PROPERTY_FEATURES and any other tidy-ups following the delete, so you
only need to run
DELETE FROM PROPERTY_STYLE WHERE property_id = :THE_PROPERTY_ID;
and the rest happens magically ;)
Get the engine to do the grunt work and simplify the PHP (or what ever)
user end.

--
Lester Caine
-----------------------------
L.S.Caine Electronic Services