Subject Re: [IBO] Absolute unique value/generator/SP problem
Author Aage Johansen
Kevin Stanton wrote:
> ...
> I am getting reports of duplicate order numbers being issued (a very bad
> thing).
> ...
> //~~~~~~~~~~~~~~~~~~~~~~
> sp_get_nextid looks like this:
> CREATE PROCEDURE SP_GET_NEXTID(
> IDTYPE VARCHAR(15))
> RETURNS (
> NEXTID INTEGER)
> AS
> BEGIN
> if (IDType = 'QUOTE') then
> NextID = GEN_ID(GEN_QUOTES, 1);
>
> if (IDType = 'ORDERNO') then
> NextID = GEN_ID(GEN_ORDERNO, 1);
>
> /* many more of these */
> Suspend;
> end
> //~~~~~~~~~~~~~~~~~~~~~~
>
> Any ideas of my problem would be GREATLY appreciated.
>

You've got a lot of advice from Helen and others. Just one more comment:
What happens if the parameter for IDTYPE doesn't match any of your "if
(IDType = 'xxx') then"? Misspelled, wrong case, or something else. Do you
catch any unassigned NextID before you return from the SP?

--
Aage J.