Subject | Re: [firebird-support] RECREATE Procedure issue. |
---|---|
Author | Joje |
Post date | 2016-03-18T08:10:40Z |
I executed this query in my third party SQL Manager and it throws an error
Invalid token.
Dynamic SQL Error.
SQL error code = -104.
Unexpected end of command - line 30, column 36.
line number 30 has this statement "DECLARE VARIABLE URL_COUNT INTEGER;"
But the thing to note is that executing same query with ALTER will work. As this query was big and important in order to avoid any mistake i thought it was better to use RECREATE rather than ALTER. As recreate drops previous procedure and creates a new one.
If there is an dependency then firebird should have sent an error to application. Here there was no error as such.
Regarding documentation
On 2016-03-17 15:49, Joje joje@...
[firebird-support] wrote:
> Hi All,
> I am facing a issue with 'RECREATE' procedure.
>
> Problem:
> I have a stored procedure that uses 'RECREATE Procedure', this
> procedure does not execute properly when executed in EMS SQL manager
> for IB and Firebird.
> Dont know why....... :( every time i execute it. Procedure execution
> stuck as declaration variable whenever using 'RECREATE',
Could you explain what happens: do you get an error, does it hang, or
does it do nothing?
> however when
> I use 'ALTER' procedure gets executed without any error. There is no
> documentation provided in firebird site about 'RECREATE'
But there is:
http://www.firebirdsql.org/file/documentation/reference_manuals/fblangref25-en/html/fblangref25-ddl-procedure.html#fblangref25-ddl-proc-recreate
> Could some tell me whether they have faced issues with 'RECREATE' or
> have fixed this kind of issue.
>
> Thanks in Advance would appreciate your help in this matter.
You might want to use CREATE OR ALTER PROCEDURE instead
http://www.firebirdsql.org/file/documentation/reference_manuals/fblangref25-en/html/fblangref25-ddl-procedure.html#fblangref25-ddl-proc-crtoralter
The difference is that recreate drops and then creates the procedure,
while CREATE OR ALTER creates a procedure if it doesn't exist or
otherwise alters the procedure.
Mark