cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

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

Could not find stored procedure'wt_get_next_sequence_xxx'

Durga
12-Amethyst

Could not find stored procedure'wt_get_next_sequence_xxx'

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

 

6 REPLIES 6
HelesicPetr
21-Topaz II
(To: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 

BenPerry
13-Aquamarine
(To:Durga)

@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

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

 

 

BenPerry
13-Aquamarine
(To:HelesicPetr)

@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. 

TomU
23-Emerald IV
(To:BenPerry)

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.

rhart
14-Alexandrite
(To:Durga)

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

Top Tags