Subject | RE: [IBO] Transactions Scope for a Beginner |
---|---|
Author | Alan McDonald |
Post date | 2004-02-23T17:39:16Z |
>the transaction scope is set at the client. You cannot set transaction scope
> Hi All,
>
> I am a beginner at this Database ..I wanted to incorporate a
> transaction scope into my stored procedure. Sample script. If someone
> could identify with the error. Im getting Invalid token.
> Dynamic SQL Error.
> SQL error code = -104.
> Token unknown - line 9, char 13.
> SET.
>
>
> Below is the stored procedure...
>
within a stored procedure, it applies to all behaviour at the server for the
scope of the transaction
Alan
>
>
>
> CREATE PROCEDURE UPDATE_DEPT_MODIFY
> AS
> DECLARE VARIABLE DEPT_ID INTEGER;
> BEGIN
> FOR SELECT TB001_MR_DEPARTMENT.FD001_ID FROM
> TB001_MR_DEPARTMENT INTO :DEPT_ID
> DO
> BEGIN
>
> SET TRANSACTION UPDATE_DEPT;
>
>
> UPDATE TB001_MR_DEPARTMENT SET
> TB001_MR_DEPARTMENT.FD001_MODIFY_BY=:DEPT_ID
> WHERE TB001_MR_DEPARTMENT.FD001_ID = :DEPT_ID;
>
> IF (DEPT_ID =2)
> THEN
> BEGIN
> COMMIT TRANSACTION UPDATE_DEPT;
>
> END
> ELSE
> BEGIN
> ROLLBACK TRANSACTION UPDATE_DEPT;
> END
>
>
> END
>
> END
>
>
>
>
> __________________________________________________________________
> _________
> IB Objects - direct, complete, custom connectivity to Firebird or
> InterBase
> without the need for BDE, ODBC or any other layer.
> __________________________________________________________________
> _________
> http://www.ibobjects.com - your IBO community resource for Tech
> Info papers,
> keyword-searchable FAQ, community code contributions and more !
>
> Yahoo! Groups Links
>
>
>
>
>
>
>