Subject | Re: My First Procedure |
---|---|
Author | Adam |
Post date | 2009-02-24T22:50:56Z |
> How do I test for the existance ofWe keep our patches sequential and have a table that stores the
> the procedure or trigger name?
patches that have been applied to the database.
But in this case you could also use:
CREATE OR ALTER PROCEDURE
and
CREATE OR ALTER TRIGGER
> Because DSQL does not recognize terminators for statements (P574 PPSET TERM is an iSQL thing. ISQL's job is to run a sequence of SQL
> 6), can I safely dispense with SET TERM statements?
statements delimited by a terminator character (default ';'). The
problem is that the ';' character is also used in PSQL to indicate the
end of a command.
Imagine you wrote the following procedure:
CREATE OR ALTER PROCEDURE FOO
AS
DECLARE VARIABLE I INTEGER;
BEGIN
I = 0;
END
When iSQL parses this text to look for the SQL command, if the
terminator was a ';', it would get the following:
Command 1:
CREATE OR ALTER PROCEDURE FOO
AS
DECLARE VARIABLE I INTEGER;
Command 2:
BEGIN
I = 0;
etc....
SET TERM is not a magical DSQL command, it simply tells iSQL to change
the terminator character of a SQL command while you define some PSQL
blocks.
But outside iSQL (and other equivalent script runners) it really has
no relevance.
Adam