Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X
Hi All,
Trying to create a new sequence for WTPart subtype referring to Article - CS42301.
A new sequence got created successfully. Replaced the sequence in OIR.
When try to create new part it giving error: Could not find stored procedure'wt_get_next_sequence_xxx'.
Anyone who has tried this could let me know the modifications to be done.
Thanks in advance
Regards,
Durga
Hi @Durga
Error tells you that procedure does not exist.
Have you checked if the procedure is created in database with correct name?
This is first thing I would check.
PetrH
https://www.ptc.com/en/support/article/CS42301 is wrong. The part in RED text below is missing from the article. This is a modified example using custom sequence wt_sequence_MY_CUSTOM_SEQ as an example. Please confirm whether this works for you.
Hi @BenPerry
You right if the name of your sequence is "wt_sequence_MY_CUSTOM"
if the name is just "OWN" you don't need to add the wt_sequence string
for example:
CREATE TABLE OWN_seq (dummy CHAR(1),value BIGINT IDENTITY(0366000, 1))
go
CREATE PROCEDURE [wcuser].[wt_get_next_sequence_OWN_seq]
@returnValue BIGINT OUTPUT
AS
INSERT OWN_seq (dummy) VALUES ('x')
SELECT @returnValue = SCOPE_IDENTITY()
GO
So the article is not generally wrong. PTC could correct it if you send a feedback.
PetrH
Yes, the article is actually wrong. In the example for creating the table/etc, it calls the sequence "wt_sequence_test". But in the example OIR, the sequence name is just "test".
If the correct example sequence name is "wt_sequence_test", then the OIR example needs to be adjusted. And the CREATE PROCEDURE needs to be adjusted to "wt_get_next_sequence_wt_sequence_test".
The article is not fully correct and has led to many confused people. including @Durga and some of my colleagues.
The sequence name and the table name can be anything you want, they just have to properly refer to each other and be called by the OIR using the same name.
My db has a name windchill_inst, so we need to include that when defining the table and procedure.
CREATE TABLE windchill_inst.wt_sequence_SPARTID_seq (dummy CHAR(1), value BIGINT IDENTITY(4000799, 1))
go
CREATE PROCEDURE windchill_inst.wt_get_next_sequence_SPARTID_seq @returnValue BIGINT OUTPUT
AS
INSERT windchill_inst.wt_sequence_SPARTID_seq (dummy) VALUES ('x')
SELECT @returnValue = SCOPE_IDENTITY()
go