2022年11月2日 星期三

JS邏輯運算子

會先將值轉換為布林值, 再取兩者其中之一.


var a = 123;
var b = "abc";
var c = null;
var d = undefined;
//undefined, Null, +0, -0 or NaN, 空字串""或''會轉換為falsy, 其他為truthy

console.log(a||c); // ||(or) 若第一個值轉換為truthy, 則回傳第一個值
console.log(c||a); // ||(or) 若第一個值轉換為falsy, 則回傳第二個值
console.log(a&&c); // &&(and) 若第一個truthy, 則回傳第二個值
console.log(c&&a); // &&(and) 若第一個值為falsy, 則回傳第一個值

2022年10月27日 星期四

JS判斷瀏覽器IE自動轉換Edge或Chrome

 

  1. 提示IE不支援, Edge開啟. IE導向其他頁面

<script>

    if (/MSIE \d|Trident.*rv:/.test(navigator.userAgent)) {

        alert("IE is not supported.");

        window.location = 'microsoft-edge:' + location.href;

       

        setTimeout(function () {

            window.location.href = 'https://localhost';

            //window.close();

        }, 1);

    }

</script>

 

  1. 直接轉Chrome開啟, IE導向其他頁面

<script>

    if (/MSIE \d|Trident.*rv:/.test(navigator.userAgent)) {

       

        var objShell = new ActiveXObject("WScript.Shell");

        objShell.Run("cmd.exe /c start "  + location.href, 0, true);

        setTimeout(function () {

            //history.go(-2);

            window.location.href = 'https://localhost';

            //window.close();

            }, 1);

    }

</script>

ORDS+IIS轉址

 https://medium.com/@rammelhofdotat/iis-and-oracle-apex-ords-437908c79e2

1. 先安裝ORDS

2. IIS新增Sites

3. 設定Rule


ReverseProxy





HTTP>HTTPS








2022年10月24日 星期一

[EBS]Query to find Form Function attached to which Responsibility

https://www.funoracleapps.com/2020/03/query-to-find-form-function-attached-to.html 


SELECT DISTINCT faa.application_name application, rtl.responsibility_name,

ffl.user_function_name, ff.function_name, ffl.description,

ff.TYPE,rtl.language

FROM fnd_compiled_menu_functions cmf,

fnd_form_functions ff,

fnd_form_functions_tl ffl,

fnd_responsibility r,

fnd_responsibility_tl rtl,

apps.fnd_application_all_view faa

WHERE cmf.function_id = ff.function_id

AND r.menu_id = cmf.menu_id

AND rtl.responsibility_id = r.responsibility_id

AND cmf.grant_flag = 'Y'

AND ff.function_id = ffl.function_id

AND faa.application_id(+) = r.application_id

AND UPPER(rtl.responsibility_name) LIKE '%Responsibility_Name%'

--and ffl.user_function_name like '%&Function_Name%'

AND r.end_date IS NULL

AND rtl.language='US'

ORDER BY rtl.responsibility_name;

2022年10月19日 星期三

Oracle APEX EXPORT & IMPORT Application

 


https://docs.oracle.com/en/database/oracle/apex/22.1/aeadm/exporting-and-importing-using-sqlcl.html

EXPORT Application

Step1. Download SQLcl

https://www.oracle.com/database/sqldeveloper/technologies/sqlcl/download/ 


Step2. (Windows)透過提示命令字元或PowerShell連至DB

切換至SQLcl目錄, 例如: D:\Tools\sqlcl-latest\sqlcl\bin

執行: sql.exe ${username}/${password}@//${00.00.00.000:1521}/${DatabaseName}


Step3. Export Application

執行: apex export -applicationid ${appid} -dir ${path}

例如: apex export -applicationid 224 -dir D:/apex_backup

產生 f224.sql 於目錄 D:/apex_backup




Import Application

於SQLcl執行export的sql file

例如: @D:/apex_backup/f224.sql

2022年9月21日 星期三

ORA-04021:timeout occurred while waiting to lock object

1. 先查詢是否被Lock 

SELECT

b.SID,

b.USERNAME,

b.MACHINE,

b.SERIAL#

FROM

V$ACCESS a,

V$SESSION b

WHERE

a.SID = b.SID

AND a.OBJECT = '%PACKAGE_NAME%'

AND a.TYPE = 'PACKAGE';


2. 若是被Lock, 砍掉該筆session

alter system kill session 'sid,serial#'

2022年9月19日 星期一

[EBS]取得responsibility

 Useful query to get user id, responsibility id and application id in EBS.

To know about User Id use below Query:-


SQL> select user_id from fnd_user where user_name=’DOYEN’;


To know about Responsibility id use below Query:-


SQL> select responsibility_id,RESPONSIBILITY_NAME from fnd_responsibility_vl where responsibility_name like ‘%India%Local%Payables%’;


To Know about Application id use below Query:-

https://doyensys.com/blogs/useful-query-to-get-user-id-responsibility-id-and-application-id-in-ebs/


SQL>select APPLICATION_ID from fnd_responsibility_vl where responsibility_id=50366;


To Know about Org id from po:-


SQL>select org_id from po_headers_all where segment1=’&PO’;


To know about Requisition Org id from requisition number:-


$SQL>select hr.name, prh.segment1, prh.org_id from po_requisition_headers_all prh, hr_all_organization_units hr where prh.org_id = hr.organization_id and prh.segment1 = ‘&Enter_Req_Number’;