update sequence immediately

This commit is contained in:
Carlos Ruiz 2007-02-14 04:17:56 +00:00
parent 0ba3d62cb7
commit d78bbc4a56
2 changed files with 34 additions and 24 deletions

View File

@ -1,12 +1,19 @@
insert into AD_MESSAGE (
"AD_MESSAGE_ID","AD_CLIENT_ID","AD_ORG_ID","ISACTIVE","CREATED","CREATEDBY","UPDATED","UPDATEDBY",
"VALUE","MSGTEXT","MSGTIP","MSGTYPE","ENTITYTYPE"
)
values (
50007,0,0,'Y',to_date('12-02-2007','DD-MM-RRRR'),0,to_date('12-02-2007','DD-MM-RRRR'),0,
'Charset','Charset','Charset used for import / export','I','D'
);
INSERT INTO ad_message
(ad_message_id, ad_client_id, ad_org_id, isactive, created,
createdby, updated, updatedby, VALUE,
msgtext, msgtip, msgtype, entitytype
)
VALUES (50007, 0, 0, 'Y', TO_DATE ('12-02-2007', 'DD-MM-RRRR'),
0, TO_DATE ('12-02-2007', 'DD-MM-RRRR'), 0, 'Charset',
'Charset', 'Charset used for import / export', 'I', 'D'
);
commit;
COMMIT ;
-- Run sequence check
UPDATE ad_sequence
SET currentnextsys = (SELECT MAX (ad_element_id) + 1
FROM ad_element
WHERE ad_element_id < 1000000)
WHERE NAME = 'AD_Message';
COMMIT;

View File

@ -1,15 +1,18 @@
insert into AD_MESSAGE_TRL (
"AD_MESSAGE_ID", "AD_LANGUAGE", "AD_CLIENT_ID","AD_ORG_ID","ISACTIVE","CREATED","CREATEDBY","UPDATED","UPDATEDBY",
"MSGTEXT","MSGTIP","ISTRANSLATED"
)
select
m.AD_Message_ID, lang.AD_Language, m.AD_Client_ID, m.AD_Org_ID, 'Y', m.Created, m.CreatedBy, m.Updated, m.UpdatedBy,
m.MsgText, m.MsgTip, 'N'
from AD_Message m, AD_Language lang
where
m.AD_Message_ID = 50007
and lang.IsSystemLanguage='Y' and lang.IsBaseLanguage='N'
and not exists (select * from AD_Message_TRL m2 where m2.AD_Message_ID=m.AD_Message_ID and m2.AD_Language=lang.AD_Language)
;
INSERT INTO ad_message_trl
(ad_message_id, ad_language, ad_client_id, ad_org_id, isactive,
created, createdby, updated, updatedby, msgtext, msgtip,
istranslated)
SELECT m.ad_message_id, lang.ad_language, m.ad_client_id, m.ad_org_id, 'Y',
m.created, m.createdby, m.updated, m.updatedby, m.msgtext, m.msgtip,
'N'
FROM ad_message m, ad_language lang
WHERE m.ad_message_id = 50007
AND lang.issystemlanguage = 'Y'
AND lang.isbaselanguage = 'N'
AND NOT EXISTS (
SELECT *
FROM ad_message_trl m2
WHERE m2.ad_message_id = m.ad_message_id
AND m2.ad_language = lang.ad_language);
commit;
COMMIT ;