2019年3月12日 星期二

日期運算的方式

下面是日期運算的方式

select
TO_CHAR(SYSDATE - INTERVAL '3' YEAR, 'YYYYMMDDHH24') ToYEAR,
--=>從系統日期算起往前 3 年
TO_CHAR(SYSDATE - INTERVAL '3' month, 'YYYYMMDDHH24') ToMONTH,
--=>從系統日期算起往前 3 個月
TO_CHAR(SYSDATE - INTERVAL '30' DAY, 'YYYYMMDDHH24') ToDay,
--=>從系統日期算起往前 30 天
TO_CHAR(SYSDATE - INTERVAL '30' HOUR, 'YYYYMMDDHH24') ToHOUR,
--=>從系統日期算起往前 30 小時
TO_CHAR(SYSDATE - INTERVAL '30' minute, 'YYYYMMDD HH24:MI:SS') ToMinute,
--=>從系統日期算起往前 30 分鍾
TO_CHAR(SYSDATE - INTERVAL '50' second,'YYYYMMDD HH24:MI:SS') ToSecond,
--=>從系統日期算起往前 50 秒
SYSDATE
--系統日期
from xxx

2017年6月26日 星期一

Print QR Code in Oracle Reports

Print QR Code in Oracle Reports

https://community.oracle.com/thread/4008736
http://samizaffar.blogspot.tw/2014/03/print-qr-code-in-oracle-reports.html


https://blogs.oracle.com/xmlpublisher/quick-quips-on-qr-codes

2015年5月15日 星期五

Update data from another Table

UPDATE (
SELECT b.col1 as old_col1,
       b.col2 as old_col2,
       b.col3 as old_col3,
       t.col1 as new_col1,
       t.col2 as new_col2,
       t.col3 as new_col3 
  FROM bigTable b, tempTable t
 WHERE b.col = t.col)
   SET old_col1 = new_col1,
       old_col2 = new_col2,
       old_col3 = new_col3;




參考 http://blog.csdn.net/yuhua3272004/article/details/2776121

2015年4月6日 星期一

Oracle WIP Jobs Pending Resource Transactions, Pending Transactions in WIP_COST_TXN_INTERFACE Table


To find out the pending transactions from the application navigate to
WIP -> Discrete -> WIP Resource Transactions -> Pending Resource Transactions   and enter WIP Job name or any required parameter.
Here in this from you can find all the Pending Resource Transactions, if you could find your transaction in this form then that means your transaction got struck in Interface table [WIP_COST_TXN_INTERFACE].

Cause of Problem:

Usually this is caused if there is an problem with  ‘Cost Manager‘ and some times with  ‘Move Transaction Manager‘ too.

Solution:

Step 1: Identify your pending transactions in WIP_COST_TXN_INTERFACE table using the following query
SELECT transaction_id,
  request_id,
  GROUP_ID,
  process_status,
  wip_entity_name
FROM wip_cost_txn_interface
WHERE process_status IN (1, 3)
AND wip_entity_name   ='&ur_wipjob_name';
here
PROCESS_STATUS = 1 means Pending and
PROCESS_STATUS = 3 means Error
Note down all the transactions_id which you need to fix.
Step 2:  Take a backup of WIP_COST_TXN_INTERFACE table
Step 3:   Stop the Cost Manager & Move Transaction Manager
to stop these programs you need to navigate to INVENTORY –> Setup –>Transactions –> Interface Managers and then select the program and go to Tools menu.
Step 4: 
  • If the PROCESS_STATUS = 1 (Pending) , run the following script:
UPDATE wip_cost_txn_interface
  SET GROUP_ID = NULL,
  transaction_id = NULL
WHERE transaction_id IN (x, y, z);
x y z = transaction_ids of stuck transactions.
If  you want to fix all records in WIP_COST_TXN_INTERFACE table then run the following script:
UPDATE wip_cost_txn_interface
SET GROUP_ID = NULL,
transaction_id = NULL,
process_status = 1;
  • If the PROCESS_STATUS = 3 (Error) , run the following script:
UPDATE wip_cost_txn_interface
SET GROUP_ID = NULL,
process_status = 1
WHERE process_status = 3;
Step 5:  Restart the Cost Manager and Move Transaction Manager.
Navigate to Pending Resource Transaction Form and now you can’t find your transaction here as they are cleared,

2014年10月12日 星期日

message dictionary couldn't open the application message file


在 OM 的 MENU 上掛上一個請求群組, 但是當登入後第一次進入時, 都會發生 此訊息





解決方式如下:

這是FUNCTION > FORM >PARAMETER 的值

REQUEST_GROUP_CODE="XXHS_OM_STAT" REQUEST_GROUP_APPL_SHORT_NAME="ONT" TITLE="OM: HS 銷貨統計報表" USE_ORG="Y"

我把其中的 OM: 拿掉變成

REQUEST_GROUP_CODE="XXHS_OM_STAT" REQUEST_GROUP_APPL_SHORT_NAME="ONT" TITLE="HS 銷貨統計報表" USE_ORG="Y"

就OK了, 反覆測試過兩三次確認無誤