Skip to Content
author's profile photo Former Member
Former Member

FMS: Internal Error (3006) (Message 131-183)

Hi all,

I have created this query for ItemCode generation:

DECLARE @num as nvarchar(20);

DECLARE @max_num as integer;

SET @num =$[$U_Level1.0.0] +$[$U_Level2.0.0] + $[$U_Level3.0.0]

SET @max_num = CASE WHEN NOT EXISTS(SELECT itemcode from OITM where itemcode like @num + '%')

THEN 0 ELSE (SELECT MAX( CAST (REPLACE(Itemcode, @num, '') AS INT)) FROM OITM where itemcode like @num + '%') END

SELECT @num + STUFF(

'00000',

6 - LEN(CAST(@max_num + 1 as nvarchar (20))),

LEN(CAST(@max_num + 1 as nvarchar (20))),

CAST(@max_num + 1 as nvarchar (20)))

When i'm adding this FMS to UDF field it is works fine (like on screenshot)

But when i'm adding this FMS to ItemCode field and press the magnifying glass, i'm receiving error:

"Internal Error (3006) (Message 131-183)"

I'm also tried to use magic symbol '-' before the item index, but in that case FMS does not work even in my UDF...

Will be appreciate for any help.

--

Best regards,

Alexander

screen1.png (21.7 kB)
Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on May 21, 2015 at 10:51 AM

    Problem solved after changing syntax: $[OITM.U_Level1] instead of $[$U_Level1.0.0] .

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.