0 Bewertungen0% fanden dieses Dokument nützlich (0 Abstimmungen)
22 Ansichten4 Seiten
This document contains 7 queries related to Oracle applications:
1. Finds flexfields and valuesets from various tables.
2. Finds responsibilities from responsibility and translation tables.
3. Finds descriptive field information for PO and GL from various descriptive flex tables.
4. Finds menus from menu, translation and entry tables.
5. Finds responsibilities, attached menus and applications for a given responsibility from various tables.
6. Extracts vendor information from vendor and site tables.
7. Extracts information for blanket purchase agreements from various purchase order tables.
This document contains 7 queries related to Oracle applications:
1. Finds flexfields and valuesets from various tables.
2. Finds responsibilities from responsibility and translation tables.
3. Finds descriptive field information for PO and GL from various descriptive flex tables.
4. Finds menus from menu, translation and entry tables.
5. Finds responsibilities, attached menus and applications for a given responsibility from various tables.
6. Extracts vendor information from vendor and site tables.
7. Extracts information for blanket purchase agreements from various purchase order tables.
This document contains 7 queries related to Oracle applications:
1. Finds flexfields and valuesets from various tables.
2. Finds responsibilities from responsibility and translation tables.
3. Finds descriptive field information for PO and GL from various descriptive flex tables.
4. Finds menus from menu, translation and entry tables.
5. Finds responsibilities, attached menus and applications for a given responsibility from various tables.
6. Extracts vendor information from vendor and site tables.
7. Extracts information for blanket purchase agreements from various purchase order tables.
1. Quer y t o f i nd t he Fl exf i el ds and val ueset s
SELECT A. I D_FLEX_STRUCTURE_CODE, B. I D_FLEX_CODE, E. LANGUAGE, D. FLEX_VALUE, E. DESCRI PTI ON, E. FLEX_VALUE_MEANI NG, B. FLEX_VALUE_SET_I D, B. APPLI CATI ON_COLUMN_NAME, B. SEGMENT_NAME, C. FLEX_VALUE_SET_NAME, D. FLEX_VALUE_I D FROM APPS. f nd_i d_f l ex_st r uct ur es A, APPS. f nd_i d_f l ex_segment s B, APPS. f nd_f l ex_val ue_set s C, APPS. f nd_f l ex_val ues D, APPS. f nd_f l ex_val ues_t l E WHERE A. I D_FLEX_NUM=B. I D_FLEX_NUM - - AND A. I D_FLEX_CODE=' GL#' - - AND B. I D_FLEX_CODE=' GL#' AND B. FLEX_VALUE_SET_I D=C. FLEX_VALUE_SET_I D AND C. FLEX_VALUE_SET_I D=D. FLEX_VALUE_SET_I D AND D. FLEX_VALUE_I D=E. FLEX_VALUE_I D AND A. APPLI CATI ON_I D I N ( 101, 201) AND E. LANGUAGE=' US' ORDER BY A. I D_FLEX_STRUCTURE_CODE
2. Quer y t o f i nd t he Responsi bi l i t es SELECT B. RESPONSI BI LI TY_I D, A. RESPONSI BI LI TY_NAME, A. LANGUAGE, B. RESPONSI BI LI TY_KEY , B. APPLI CATI ON_I D FROM APPS. FND_RESPONSI BI LI TY_TL A, APPS. FND_RESPONSI BI LI TY B WHERE A. RESPONSI BI LI TY_I D( +) =B. RESPONSI BI LI TY_I D AND A. LANGUAGE = USERENV( ' LANG' ) ORDER BY A. RESPONSI BI LI TY_NAME 3. Quer y t o f i nd t he Descr i pt i ve Fi el d i nf or mat i on f or PO and GL sel ect f l ex_vl . t i t l e, f l ex. descr i pt i ve_f l exf i el d_name, cont ext _vl . descr i pt i ve_f l ex_cont ext _code, cont ext _vl . descr i pt i on, col _usage_vl . appl i cat i on_col umn_name, col _usage_vl . end_user _col umn_name f r omapps. FND_DESCRI PTI VE_FLEXS f l ex, apps. FND_DESCRI PTI VE_FLEXS_vl f l ex_vl , apps. FND_DESCR_FLEX_CONTEXTS_VL cont ext _vl , apps. FND_DESCR_FLEX_COL_USAGE_VL col _usage_vl wher e f l ex_vl . appl i cat i on_i d i n ( 201, 101) and f l ex_vl . t i t l e = ' Appr oved Suppl i er Li st ' and f l ex. descr i pt i ve_f l exf i el d_name = f l ex_vl . descr i pt i ve_f l exf i el d_name - - ' PO_APPROVED_SUPPLI ER_LI ST' and f l ex. descr i pt i ve_f l exf i el d_name = cont ext _vl . descr i pt i ve_f l exf i el d_name and f l ex. descr i pt i ve_f l exf i el d_name = col _usage_vl . descr i pt i ve_f l exf i el d_name and col _usage_vl . descr i pt i ve_f l ex_cont ext _code = cont ext _vl . descr i pt i ve_f l ex_cont ext _code - - ' 2346' or der by col _usage_vl . descr i pt i ve_f l ex_cont ext _code, col _usage_vl . appl i cat i on_col umn_name 4. Quer y t o f i nd t he Menus
SELECT B. ROWI D ROW_I D, B. MENU_I D, B. MENU_NAME, Example of Extract Query http://www.erpgreat.com/oracle-database/example-of-extract-query.htm 1 sur 4 09/09/2014 17:50 B. TYPE, B. LAST_UPDATE_DATE, B. LAST_UPDATED_BY , B. LAST_UPDATE_LOGI N , B. CREATI ON_DATE , B. CREATED_BY , T. USER_MENU_NAME , T. DESCRI PTI ON, T. LANGUAGE, C. SUB_MENU_I D FROM apps. FND_MENUS_TL T, apps. FND_MENUS B, apps. FND_MENU_ENTRI ES C - - ( SELECT USER_MENU_NAME, MENU_I D FROM FND_MENUS_TL) SUB WHERE B. MENU_I D = T. MENU_I D AND T. LANGUAGE = USERENV( ' LANG' ) - - AND T. USER_MENU_NAME = ' Act i vi t y Based Management ' AND B. MENU_I D=C. MENU_I D 5. Quer y t o f i nd t he Responsi bi l i t y, At t ached Menu and Appl i cat i on t o t he par t i cul ar r esponsi bi l i t y SELECT di st i nct B. RESPONSI BI LI TY_I D, A. RESPONSI BI LI TY_NAME, A. LANGUAGE, B. RESPONSI BI LI TY_KEY , B. APPLI CATI ON_I D, C. USER_MENU_NAME, E. APPLI CATI ON_NAME FROM APPS. FND_RESPONSI BI LI TY_TL A, APPS. FND_RESPONSI BI LI TY B, APPS. FND_MENUS_TL C, APPS. FND_MENUS D, apps. FND_APPLI CATI ON_TL E, apps. FND_APPLI CATI ON F WHERE A. RESPONSI BI LI TY_I D( +) =B. RESPONSI BI LI TY_I D AND B. MENU_I D=C. MENU_I D AND B. MENU_I D=D. MENU_I D AND E. APPLI CATI ON_I D=F. APPLI CATI ON_I D AND F. APPLI CATI ON_I D=B. APPLI CATI ON_I D AND A. LANGUAGE=' US' 6. Vendor Ext r act i on Quer y sel ect d. vendor _name , d. segment 1 GSL_NUmber , e. vendor _si t e_code , e. addr ess_l i ne1 , e. addr ess_l i ne2 , e. addr ess_l i ne3 , e. ci t y , e. st at e , e. zi p , e. pr ovi nce , e. count r y , subst r ( e. at t r i but e14, 1, 3) , d. l ast _updat e_dat e , d. l ast _updat ed_by , d. cr eat i on_dat e , d. cr eat ed_by , d. set _of _books_i d , e. vendor _si t e_code , e. vendor _si t e_code_al t , e. pur chasi ng_si t e_f l ag , e. pay_si t e_f l ag , e. addr ess_l i ne1 , e. addr ess_l i neS_al t , e. addr ess_l i ne2 , e. addr ess_l i ne3 Example of Extract Query http://www.erpgreat.com/oracle-database/example-of-extract-query.htm 2 sur 4 09/09/2014 17:50 , e. ci t y , e. st at e , e. zi p , e. pr ovi nce , e. count r y , e. phone , e. cust omer _num , e. shi p_t o_l ocat i on_i d , e. bi l l _t o_l ocat i on_i d , e. shi p_vi a_l ookup_code , e. f r ei ght _t er ms_l ookup_code , e. payment _met hod_l ookup_code , e. t er ms_dat e_basi s , e. acct s_pay_code_combi nat i on_i d , e. pr epay_code_combi nat i on_i d , e. payment _pr i or i t y , e. t er mS_i d , e. i nvoi ce_amount _l i mi t , e. pay_dat e_basi s_l ookup_code , e. i nvoi ce_cur r ency_code , e. payment _cur r ency_code , e. hol d_unmat ched_i nvoi ces_f l ag , e. ap_t ax_r oundi ng_r ul e , e. aut o_t ax_cal c_f l ag , e. aut o_t ax_cal c_over r i de , e. addr ess_l i ne4 , e. count y , e. mat ch_opt i on FROM PO. po_vendor s D , PO. PO_VENDOR_SI TES_ALL E WHERE E. vendor _i d = D. vendor _i d AND or g_i d i n ( 2265) - - I ni t i al i zi ng t he def aul t val ues f r omSyst emPar amet er s - - Get def aul t val ues f r omPayabl e Opt i ons
BEGI N SELECT aut o_t ax_cal c_f l ag, aut o_t ax_cal c_over r i de, amount _i ncl udes_t ax_f l ag, pay_dat e_basi s_l ookup_code, hol d_unmat ched_i nvoi ces_f l ag FROM ap_syst em_par amet er s_al l WHERE set _of _books_i d = l _sob_i d AND or g_i d = l _or g_i d; - - Get def aul t val ues f r omFi nanci al Opt i ons ( DFT02)
BEGI N SELECT mat ch_opt i on, shi p_t o_l ocat i on_i d, bi l l _t o_l ocat i on_i d, shi p_vi a_l ookup_code, f r ei ght _t er ms_l ookup_code, t ax_r oundi ng_r ul e FROM f i nanci al s_syst em_par ams_al l WHERE set _of _books_i d = l _sob_i d AND or g_i d = l _or g_i d;
SELECT t er m_i d FROM ap_t er ms WHERE name = vendor _r ecor d. t er ms_name AND ENABLED_FLAG=' Y' AND ( END_DATE_ACTI VE > SYSDATE OR END_DATE_ACTI VE I S NULL) ; 7. Ext r act i on Quer y f or Bl anket Pur chase Agr eement : SELECT pha. segment 1 po_number , pha. t ype_l ookup_code "PO TYPE" , pha. r evi si on_num, Example of Extract Query http://www.erpgreat.com/oracle-database/example-of-extract-query.htm 3 sur 4 09/09/2014 17:50 pha. cr eat i on_dat e " PO DATE", pha. vendor _i d, pv. vendor _name, pha. vendor _si t e_i d, pvs. vendor _si t e_code, bi l l _hr l . l ocat i on_code " Bi l l To" , shi p_hr l . l ocat i on_code " Shi p To" , pha. aut hor i zat i on_st at us, - - pav. agent _name "Buyer " , ppf . f ul l _name " Buyer " , pha. cur r ency_code, pl a. l i ne_num, pl a. i t em_i d, ( SELECT DI STI NCT segment 1 FROM apps. mt l _syst em_i t ems WHERE i nvent or y_i t em_i d=pl a. i t em_i d ) i t em_name, pl a. i t em_descr i pt i on, pl a. cat egor y_i d, ( SELECT DI STI NCT segment 1| | ' . ' | | segment 2 FROM apps. mt l _cat egor i es WHERE cat egor y_i d=pl a. cat egor y_i d) "Cat egor y" , pl a. l i ne_t ype_i d, ( SELECT DI STI NCT l i ne_t ype FROM apps. po_l i ne_t ypes WHERE l i ne_t ype_i d = pl a. l i ne_t ype_i d) l i ne_t ype, pl a. uni t _meas_l ookup_code, pl a. uni t _pr i ce, pl a. t ax_name - - at s. name TAX_CODE FROM apps. po_header s_al l pha, apps. po_l i nes_al l pl a, apps. po_vendor s pv, apps. po_vendor _si t es_al l pvs, apps. po_agent s_v pav, apps. hr _l ocat i ons bi l l _hr l , apps. hr _l ocat i ons shi p_hr l , - - apps. po_agent s_v pav, apps. per _al l _peopl e_f ppf - - apps. ap_t ax_codes at s WHERE pha. po_header _i d = pl a. po_header _i d AND pha. vendor _i d = pv. vendor _i d AND pha. vendor _i d = pvs. vendor _i d AND pha. vendor _si t e_i d = pvs. vendor _si t e_i d( +) - - AND pl a. t ax_code_i d=at s. t ax_i d - - AND pha. agent _i d = pav. agent _i d( +) AND pha. agent _i d = ppf . per son_i d AND pha. t ype_l ookup_code I N ( ' BLANKET' , ' STANDARD' ) AND NVL ( pha. cl osed_code, ' OPEN' ) NOT I N ( ' CLOSED' , ' FI NALLY CLOSED' ) AND NVL ( pl a. cl osed_code, ' OPEN' ) NOT I N ( ' CLOSED' , ' FI NALLY CLOSED' ) AND pha . or g_i d =2265 AND bi l l _hr l . l ocat i on_i d = pha. bi l l _t o_l ocat i on_i d AND shi p_hr l . l ocat i on_i d = pha. shi p_t o_l ocat i on_i d ORDER BY 1 DESC Quick Links: Do you have an Oracle Question? Return to : Oracle Database, SQL, Application, Programming Tips Example of Extract Query http://www.erpgreat.com/oracle-database/example-of-extract-query.htm 4 sur 4 09/09/2014 17:50