Process card generation
The process card is a manifest form of management and description of the production technology process in the manufacturing industry. It can be understood by the process card, and it can reflect the process of technology. In MRPIIK, you can pass multiple layers of BOM After the table extraction, the flow card is automatically generated by the database, the following is the database process of the process of the process card.
CREATE Procedure Pro_Card
AS
SELECT PARENT, MAX (PARNT_DESC) AS PARNT_DESC,
Max (Case Component When 'WC [R] 101' Ten Comp_Desc Else Null End) AS 'WC [R] 101',
Max (Case Component When 'WC [R] 102' Ten Comp_Desc Else Null End) AS 'WC [R] 102',
Max (Case Component When 'WC [R] 103' Ten Comp_Desc Else Null End) AS 'WC [R] 103',
Max (Case Component When 'WC [R] 104' Ten Comp_Desc Else Null End) AS 'WC [R] 104',
Max (Case Component When 'WC [R] 105' Ten Comp_Desc Else Null End) AS 'WC [R] 105',
Max (Case Component When 'WC [R] 106' Ten Comp_Desc Else Null End) AS 'WC [R] 106',
Max (Case Component When 'WC [R] 107' Ten Comp_Desc Else Null End) AS 'WC [R] 107',
Max (Case Component When 'WC [R] 108' Ten Comp_Desc Else Null End) AS 'WC [R] 108',
Max (Case Component When 'WC [R] 109' Ten Comp_Desc Else Null End) AS 'WC [R] 109',
Max (Case Component When 'WC [R] 10b' Ten Comp_Desc Else Null End) AS 'WC [R] 10B',
Max (Case Component When 'WC [R] 10C' Ten Comp_Desc Else Null End) AS 'WC [R] 10c',
Max (Case Component When 'WC [R] 10d' Ten Comp_Desc Else Null End) AS 'WC [R] 10d'
Max (Case Component When 'WC [R] 10e' Ten Comp_Desc Else Null End) AS 'WC [R] 10E',
Max (Case Component When 'WC [R] 201' Ten Comp_Desc Else Null End) AS 'WC [R] 201',
Max (Case Component When'WC [R] 202 'Ten Comp_Desc Else Null End) AS' WC [R] 202 ',
Max (Case Component when'wc [r] 203 'TEN COMP_DESC ELSE NULL END) AS' WC [R] 203 ', Max (Case Component When'wc [R] 204' Ten Comp_Desc Else Null End) AS 'WC [R ] 204 ',
Max (Case Component by'wc [r] 205 'Ten Comp_Desc Else Null End) AS' WC [R] 205 ',
Max (Case Component When'WC [R] 206 'Ten Comp_Desc Else Null End) AS' WC [R] 206 ',
Max (Case Component When 'WC [R] 207' Ten Comp_Desc Else Null End) AS 'WC [R] 207',
Max (Case Component When'wc [R] 208 'Ten Comp_Desc Else Null End) AS' WC [R] 208 ',
Max (Case Component When 'WC [R] 301' Ten Comp_Desc Else Null End) AS 'WC [R] 301',
Max (Case Component When 'WC [R] 302' Ten Comp_Desc Else Null End) AS 'WC [R] 302',
Max (Case Component When 'WC [R] 303' Ten Comp_Desc Else Null End) AS 'WC [R] 303',
Max (Case Component When 'WC [R] 304' Ten Comp_Desc Else Null End) AS 'WC [R] 304',
Max (Case Component When 'WC [R] 305' Ten Comp_Desc Else Null End) AS 'WC [R] 305',
Max (Case Component When 'WC [R] 306' Ten Comp_Desc Else Null End) AS 'WC [R] 306',
Max (Case Component When 'WC [R] 307' Ten Comp_Desc Else Null End) AS 'WC [R] 307',
Max (Case Component When 'WC [R] 308' Ten Comp_Desc Else Null End) AS 'WC [R] 308',
Max (Case Component When 'WC [R] 309' Ten Comp_Desc Else Null End) AS 'WC [R] 309',
Max (Case Component When 'WC [R] 501' Ten Comp_Desc Else Null End) AS 'WC [R] 501',
Max (Case Component When 'WC [R] 601' Ten Comp_Desc Else Null End) AS 'WC [R] 601',
Max (Case Component When 'WC [R] 701' Ten Comp_Desc Else Null End) AS 'WC [R] 701',
Max (Case Component When 'WC [R] 801' Ten Comp_Desc Else Null End) AS 'WC [R] 801'From M_bom
GROUP BY PARENT
Go
Establish a stored procedure, generate a data crosstab, which is a basic job.
Establish the following DTS package to generate table p_card
Figure one
Generating a view on the basis of Table P_Card is the result of our ultimate results PR_CARD
The code of Pr_Card is as follows:
Create View Pr_Card
AS
SELECT PARENT, PARNT_DESC,
LTRIM (ISNULL ([WC [R]] 101], Space (1)) Space (1)) LTRIM (ISNULL ([WC [R]] 102], Space (1)) Space (1))
LTRIM (ISNULL ([WC [R]] 103], Space (1)) Space (1)) LTRIM (ISNULL ([WC [R]] 104], Space (1)) Space (1))
LTRIM (ISNULL ([WC [R]] 105], Space (1)) Space (1)) LTRIM (ISNULL ([WC [R]] 106], Space (1)) Space (1))
LTRIM (ISNULL ([WC [R]] 107], Space (1)) Space (1)) LTRIM (ISNULL ([WC [R]] 108], Space (1)) Space (1))
LTRIM (ISNULL ([WC [R]] 109], Space (1)) Space (1)) LTRIM (ISNULL ([WC [R]] 10B], Space (1)) Space (1))
LTRIM (ISNULL ([WC [R]] 10c], Space (1)) Space (1)) LTRIM (ISNULL ([WC [R]] 10D], Space (1)) Space (1))
LTRIM (ISNULL ([WC [R]] 10E], Space (1)) Space (1)) LTRIM (ISNULL ([WC [R]] 201], Space (1)) Space (1))
LTRIM (ISNULL ([WC [R]] 202], Space (1)) Space (1)) LTRIM (ISNULL ([WC [R]] 203], Space (1)) Space (1))
LTRIM (ISNULL ([WC [R]] 204], Space (1)) Space (1)) LTRIM (ISNULL ([WC [R]] 205], Space (1)) Space (1))
LTRIM (ISNULL ([WC [R]] 206], Space (1)) Space (1)) LTRIM (ISNULL ([WC [R]] 207], Space (1)) Space (1))
LTRIM (ISNULL ([WC [R]] 208], Space (1)) Space (1)) LTRIM (ISNULL ([WC [R]] 301], Space (1)) Space (1))
LTRIM (ISNULL ([WC [R]] 302], Space (1)) Space (1)) LTRIM (ISNULL ([WC [R]] 303], Space (1)) Space (1))
LTRIM (ISNULL ([WC [R]] 304], Space (1)) Space (1)) LTRIM (ISNULL ([WC [R]] 305], Space (1)) Space (1))
LTRIM (ISNULL ([WC [R]] 306], Space (1)) Space (1)) LTRIM (ISNULL ([WC [R]] 307], Space (1)) Space (1)) LTRIM (ISNULL ([WC [R]] 308], Space (1)) Space (1)) LTRIM (ISNULL ([WC [R]] 309], Space (1)) Space (1))
LTRIM (ISNULL ([WC [R]] 501], Space (1)) Space (1)) LTRIM (ISNULL ([WC [R]] 601], Space (1)) Space (1))
LTRIM (ISNULL ([WC [R]] 701), Space (1)) Space (1)) ISNULL ([WC [R]] 801), Space (1)) AS Flow Card
From dbo.p_card
The design of some process cards is over, the form of the final result is as follows:
Among them, it is a representation of different stations to reflect different stations.
I am undergraduate graduate, I am willing to engage in corporate informationization. I hope interest-growing companies or companies can contact me, I am waiting.