Skip to main content
1-Visitor
May 24, 2022
Question

Could not find stored procedure'wt_get_next_sequence_xxx'

  • May 24, 2022
  • 3 replies
  • 2616 views

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

 

3 replies

HelesicPetr
22-Sapphire II
22-Sapphire II
May 24, 2022

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 

15-Moonstone
June 21, 2022

@Durga,

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.

 

 

CREATE TABLE pdmlink.wt_sequence_MY_CUSTOM_SEQ (dummy CHAR(1),value BIGINT IDENTITY(0366000, 1))
go
CREATE PROCEDURE pdmlink.wt_get_next_sequence_wt_sequence_MY_CUSTOM_SEQ @returnValue BIGINT OUTPUT
AS
INSERT pdmlink.wt_sequence_MY_CUSTOM_SEQ (dummy) VALUES ('x')
SELECT @returnValue = SCOPE_IDENTITY()
go
HelesicPetr
22-Sapphire II
22-Sapphire II
June 22, 2022

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

 

 

15-Moonstone
June 23, 2022

@HelesicPetr,

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. 

16-Pearl
June 24, 2022

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