Subject | Re: Debugging Stored Procedures |
---|---|
Author | jrodenhi |
Post date | 2006-07-25T16:08:14Z |
Luc,
I agree that this seems like a side-effect kind of approach to getting
a check number, but I thought it might be warranted in this case. In
essence, the process is much like a generator which is also a
side-effect sort of thing. But I need to be able to keep check number
sequences for many banks and I think it would be a bad practice to
establish separate generators for each bank.
In MS SQL Server, the object that most closely resembles a selectable
stored procedure is the function (introduced relatively recently
compared to Interbase/Firebird). An MS SQL Server function would not
allow me to do DML. Microsoft agrees with you, I guess.
To me, this seems like a fairly restricted use of a side-effect and
the benefits are significant. I can print checks out of Fast-Reports
getting new check numbers without having to refer to any Delphi code.
After I print the checks, my database is consistent internally and
with the checks that were printed. Down the line, if I want to use
this same database from a web-app, the check numbering process is
already available and it's consistent with the desktop version.
So, I'm feeling like "if Firebird has it, flaunt it." I like the power.
-Jack
I agree that this seems like a side-effect kind of approach to getting
a check number, but I thought it might be warranted in this case. In
essence, the process is much like a generator which is also a
side-effect sort of thing. But I need to be able to keep check number
sequences for many banks and I think it would be a bad practice to
establish separate generators for each bank.
In MS SQL Server, the object that most closely resembles a selectable
stored procedure is the function (introduced relatively recently
compared to Interbase/Firebird). An MS SQL Server function would not
allow me to do DML. Microsoft agrees with you, I guess.
To me, this seems like a fairly restricted use of a side-effect and
the benefits are significant. I can print checks out of Fast-Reports
getting new check numbers without having to refer to any Delphi code.
After I print the checks, my database is consistent internally and
with the checks that were printed. Down the line, if I want to use
this same database from a web-app, the check numbering process is
already available and it's consistent with the desktop version.
So, I'm feeling like "if Firebird has it, flaunt it." I like the power.
-Jack
--- In firebird-support@yahoogroups.com, Lucas Franzen <luc@...> wrote:
>
> Jack,
> Usually you shouldn't do DML in selectable procedures.
> Luc.
>