Archives of the TeradataForum
Message Posted: Tue, 11 Nov 2008 @ 13:43:53 GMT
Subj: | | Re: Multi Statement Transaction in Stored Procedure |
|
From: | | Dempsey, Mike |
When creating a stored procedure SQL Assistant just submits the string as it was entered - it does not edit it at all. (I don't know what the
ODBC driver and the compiler do - they may read the procedure statement by statement and cause the semicolon to move.)
As far as I know it doesn't matter where the semicolons are in a stored procedure though. The placing of the semicolon immediately before the
statement to indicate that it should be part of the previous request is a BTEQ specific convention. I don't think it has any effect on how a
stored procedure is interpreted.
I think you probably want to simply add a locking statement (for READ) in front of the Select. This ensures that the statement will wait if
someone else is updating the table.
If this is the entire procedure you might be better off creating a macro instead of a procedure. A macro is always treated as a single
transaction and will therefore do exactly what you want with less overhead.
Mike Dempsey
Teradata Client Tools
|