您的位置:首页 > 数据库

How to run debug SQL with in front end(EBS)?

2012-04-06 17:01 465 查看
Somtimes, we will need to debug some SQLs and try to run them within environment parameters.

It will be complex to debug in PL/SQL by setting fnd_client_infor or else.



Following is the way to run debug SQL quickly within the right environgment you want:



(1) Login any application or form to the situation you want to chek SQL data (e.g. Enter 'Inventory' resp, change organization to M1 and open Receiving Transaction form and go on with following steps)

(2) Click menu 'Help' - 'Diagnostics' - 'Examine'

(3) Imput apps password and OK

(4) Enter the following information in 'Examine Field and Variable Values' window:

-- Block = *SELECT*

-- Field = Input you SQL here and TAB , you will get the SQL result



Kep points: this function has lots of limitation and please find the tips below



(A)For only 1 field of just 1 row: Suggest you to try the following 'Field' to get the sense of it:



--Right Test case1:sysdate

--Right Test case2:(Select count(*) from po_headers_all)

--Right Test case3:(Select segment1 from po_headers_all where segment1 like 'TAG%' and rownum=1)

--Wrong test case 4: (Select segment1,creation_date from po_headers_all)

--Wrong test case 5: (Select segment1,creation_date from po_headers_all and rownum=1)

--Right test case 6: (Select segment1 from po_headers_all and rownum=1)



Solution: If you want to select multi rows or columns, you should change condition and select to run more times.



(B)SQL length is limited to 80



--Right Test case3:(Select segment1 from po_headers_all where segment1 like 'TAG%' and rownum=1) --Length is 79 < 80 and OK

--Wrong Test case3:(Select NVL(segment1,'88') from po_headers_all where segment1 like 'TAG%' and rownum=1) --Length overflow



Solution: If we need to run a big SQL which is more than 80 (e.g. 1000 chars), we can create a view in PL/SQL(e.g. CPO_TAG_TEST1_V) and use the view for a single query (e.g. Select segment1 from CPO_TAG_TEST1_V where rownum=1)



Hope it will be helpful in your work, especially in View debug and test data inquiry.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: