|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
闪回的目的是要让数据库在commit之后,还能恢复到之前的某个状态,整库或指定的表。
流程卡的天生
流程卡在打造业中是一个被手艺多年接纳的一种办理与形貌临盆手艺历程的一种体现情势,经由过程流程卡,能够很了然地表现了手艺的历程,在MRPIIk中,能够经由过程多层BOM表提取经由过程处置后,由数据库主动天生流程卡,以下为流程卡的天生的数据库历程
CREATEPROCEDUREPro_Card
AS
SELECTPARENT,MAX(PARNT_DESC)ASPARNT_DESC,
MAX(CASECOMPONENTWHENWC[R]101THENCOMP_DESCELSENULLEND)ASWC[R]101,
MAX(CASECOMPONENTWHENWC[R]102THENCOMP_DESCELSENULLEND)ASWC[R]102,
MAX(CASECOMPONENTWHENWC[R]103THENCOMP_DESCELSENULLEND)ASWC[R]103,
MAX(CASECOMPONENTWHENWC[R]104THENCOMP_DESCELSENULLEND)ASWC[R]104,
MAX(CASECOMPONENTWHENWC[R]105THENCOMP_DESCELSENULLEND)ASWC[R]105,
MAX(CASECOMPONENTWHENWC[R]106THENCOMP_DESCELSENULLEND)ASWC[R]106,
MAX(CASECOMPONENTWHENWC[R]107THENCOMP_DESCELSENULLEND)ASWC[R]107,
MAX(CASECOMPONENTWHENWC[R]108THENCOMP_DESCELSENULLEND)ASWC[R]108,
MAX(CASECOMPONENTWHENWC[R]109THENCOMP_DESCELSENULLEND)ASWC[R]109,
MAX(CASECOMPONENTWHENWC[R]10BTHENCOMP_DESCELSENULLEND)ASWC[R]10B,
MAX(CASECOMPONENTWHENWC[R]10CTHENCOMP_DESCELSENULLEND)ASWC[R]10C,
MAX(CASECOMPONENTWHENWC[R]10DTHENCOMP_DESCELSENULLEND)ASWC[R]10D
MAX(CASECOMPONENTWHENWC[R]10ETHENCOMP_DESCELSENULLEND)ASWC[R]10E,
MAX(CASECOMPONENTWHENWC[R]201THENCOMP_DESCELSENULLEND)ASWC[R]201,
MAX(CASECOMPONENTWHENWC[R]202THENCOMP_DESCELSENULLEND)ASWC[R]202,
MAX(CASECOMPONENTWHENWC[R]203THENCOMP_DESCELSENULLEND)ASWC[R]203,
MAX(CASECOMPONENTWHENWC[R]204THENCOMP_DESCELSENULLEND)ASWC[R]204,
MAX(CASECOMPONENTWHENWC[R]205THENCOMP_DESCELSENULLEND)ASWC[R]205,
MAX(CASECOMPONENTWHENWC[R]206THENCOMP_DESCELSENULLEND)ASWC[R]206,
MAX(CASECOMPONENTWHENWC[R]207THENCOMP_DESCELSENULLEND)ASWC[R]207,
MAX(CASECOMPONENTWHENWC[R]208THENCOMP_DESCELSENULLEND)ASWC[R]208,
MAX(CASECOMPONENTWHENWC[R]301THENCOMP_DESCELSENULLEND)ASWC[R]301,
MAX(CASECOMPONENTWHENWC[R]302THENCOMP_DESCELSENULLEND)ASWC[R]302,
MAX(CASECOMPONENTWHENWC[R]303THENCOMP_DESCELSENULLEND)ASWC[R]303,
MAX(CASECOMPONENTWHENWC[R]304THENCOMP_DESCELSENULLEND)ASWC[R]304,
MAX(CASECOMPONENTWHENWC[R]305THENCOMP_DESCELSENULLEND)ASWC[R]305,
MAX(CASECOMPONENTWHENWC[R]306THENCOMP_DESCELSENULLEND)ASWC[R]306,
MAX(CASECOMPONENTWHENWC[R]307THENCOMP_DESCELSENULLEND)ASWC[R]307,
MAX(CASECOMPONENTWHENWC[R]308THENCOMP_DESCELSENULLEND)ASWC[R]308,
MAX(CASECOMPONENTWHENWC[R]309THENCOMP_DESCELSENULLEND)ASWC[R]309,
MAX(CASECOMPONENTWHENWC[R]501THENCOMP_DESCELSENULLEND)ASWC[R]501,
MAX(CASECOMPONENTWHENWC[R]601THENCOMP_DESCELSENULLEND)ASWC[R]601,
MAX(CASECOMPONENTWHENWC[R]701THENCOMP_DESCELSENULLEND)ASWC[R]701,
MAX(CASECOMPONENTWHENWC[R]801THENCOMP_DESCELSENULLEND)ASWC[R]801
FROMM_BOM
GROUPBYPARENT
GO
创建存储历程,发生数据交织表,这是一个基本事情。
创建以下的DTS包,天生表P_Card
图一
在表P_Card的基本上天生视图也就是我们的终极要看到了却果Pr_Card
Pr_Card的代码以下:
CREATEVIEWPr_Card
AS
SELECTPARENT,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流程卡
FROMdbo.P_CARD
到些流程卡的计划就停止了,终极了局的情势以下:
个中,是使用空格来表现分歧工位的表述。
自己为本科应界卒业生,愿处置企业信息化事情,但愿有乐趣的公司或企业能够与我接洽,我在静候
闪回的目的是要让数据库在commit之后,还能恢复到之前的某个状态,整库或指定的表。 |
|