Subject RE: [IBO] Absolute unique value/generator/SP problem
Author Kevin Stanton
Good question, had to look. Actually the return value never does get
initialized.
However this hasn't happened (as of yet :) and would hopefully be very
apparent very quick in testing.
Kevin

-----Original Message-----
From: Aage Johansen [mailto:aagjohan@...]
Sent: Tuesday, June 22, 2004 11:04 AM
To: ibObjects@yahoogroups.com
Subject: Re: [IBO] Absolute unique value/generator/SP problem


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.




___________________________________________________________________________
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 Sponsor
ADVERTISEMENT





----------------------------------------------------------------------------
--
Yahoo! Groups Links

a.. To visit your group on the web, go to:
http://groups.yahoo.com/group/IBObjects/

b.. To unsubscribe from this group, send an email to:
IBObjects-unsubscribe@yahoogroups.com

c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



[Non-text portions of this message have been removed]