You are on page 1of 7

Supply a Value Set Name for &1 and get all flex values associated with it.

--------SELECT ffv.flex_value ,ffvt.description ,ffvt.flex_value_meaning ,to_char(ffv.start_date_active,'DD-MON-RRRR') FROM FND_FLEX_VALUES ffv ,fnd_flex_values_tl ffvt WHERE flex_value_set_id = (SELECT flex_value_set_id FROM FND_FLEX_VALUE_SETS ffvs WHERE flex_value_set_name = '&1') AND ffv.flex_value_id = ffvt.flex_value_id ORDER BY ffv.flex_value ASC / =========== --- select values from a user-defined table -- in HRMS. -SELECT pur.row_low_range_or_name, pucif.value FROM pay_user_column_instances_f pucif ,pay_user_rows_f pur ,pay_user_columns puc ,pay_user_tables put WHERE put.user_table_id = puc.user_table_id AND put.user_table_id = pur.user_table_id AND pucif.user_row_id = pur.user_row_id AND pucif.user_column_id = puc.user_column_id AND trunc(SYSDATE) BETWEEN pur.effective_start_date AND pur.effective_end_date AND trunc(SYSDATE) BETWEEN pucif.effective_start_date AND pucif.effective_end_date -- AND put.user_table_name = :v_table_name; ----------

=========== CREATE OR REPLACE PROCEDURE utl_gimme AS --Example to write one line to a file. This is tested --on Win2K. Limitations to UTL file include inability to change permissions --on the file(s) you create. Use embedded/external Java for advanced apps. utl_file_location VARCHAR2(100) := 'C:\utl_logs'; utl_file_name VARCHAR2(10) := 'utl.txt'; utl_file_handle utl_file.file_type; utl_mode_write CONSTANT VARCHAR2(1) := 'W'; utl_mode_append CONSTANT VARCHAR2(1) := 'A'; BEGIN utl_file_handle := UTL_FILE.FOPEN(utl_file_location,utl_file_name,utl_mode_appen d,32767); utl_file.put_line(utl_file_handle,'Write this: Hello, world'); utl_file.fclose(utl_file_handle);

/* |if utl_file.is_open('utl.txt') then | dbms_output.put_line('File is open.','W'); |else | dbms_output.put_line('Closed.'); |end if; */ END; / show errors procedure utl_gimme; ---------Your UTL script may compile but error on execution; verify you can write to a di rectory with this: SELECT * FROM v$parameter WHERE name = 'utl_file_dir'; If 'name' is null or 'no rows returned' you must: 1) edit the init.ora and supply a value for utl_file_dir. 2) utl_file_dir=* is discouraged for security. 3) Shutdown and startup database (rfo) after making the change and let the good times roll. =========== --- example of retrieving accrual from outside of -- Oracle Applications. Accruals call Fast -- Formulas; if the FF references a Global Value, -- you will need to execute this statement first: --- INSERT INTO fnd_sessions VALUES (userenv('sessionid'), trunc(SYSDATE)); --- The view FF_GLOBALS looks for a valid session id -- and will not return rows if it is null. -DECLARE l_asg l_vaca_hrs l_total_hrs l_payroll_id l_start_date l_end_date l_accrual_end_date l_accrual CURSOR SELECT FROM WHERE AND NUMBER := NULL; NUMBER := 0; NUMBER := 0; NUMBER := 0; DATE := NULL; DATE := NULL; DATE := NULL; NUMBER := 0;

c_emps IS assignment_id, payroll_id, location_id per_all_assignments_f trunc(SYSDATE) BETWEEN effective_start_date AND effective_end_date location_id = 13730;

CURSOR c_get_payroll (l_asg IN NUMBER) is SELECT payroll_id FROM per_all_assignments_f

WHERE assignment_id = l_asg AND trunc(SYSDATE) between effective_start_date AND effective_end_date; CURSOR vac_CURSOR (l_asg IN NUMBER) is SELECT pap.accrual_plan_id FROM pay_accrual_plans pap ,pay_element_links_f pel ,pay_element_entries_f pee WHERE pap.accrual_category = 'V' AND pel.element_type_id = pap.accrual_plan_element_type_id AND trunc(SYSDATE) between pel.effective_start_date AND pel.effective_end_dat e AND pee.element_link_id = pel.element_link_id AND pee.assignment_id = l_asg AND trunc(SYSDATE) between pee.effective_start_date AND pee.effective_end_dat e; BEGIN FOR i in c_emps LOOP OPEN c_get_payroll (i.assignment_id); FETCH c_get_payroll into l_payroll_id; CLOSE c_get_payroll; FOR vac_record in vac_CURSOR (i.assignment_id) LOOP BEGIN l_vaca_hrs := pay_us_pto_accrual.get_net_accrual(i.assignment_id,SYSDAT E,vac_record.accrual_plan_id,'V'); EXCEPTION WHEN no_data_found THEN dbms_output.put_line('No data found.'); dbms_output.put_line(SUBSTR(SQLERRM,1,254)); WHEN others THEN dbms_output.put_line('***********************************'); dbms_output.put_line('Asg id: '||i.assignment_id||' location_id: '|| i.location_id); dbms_output.put_line(SUBSTR(SQLERRM,1,254)); dbms_output.put_line('***********************************'); END; l_total_hrs := l_total_hrs + nvl(l_vaca_hrs, 0); dbms_output.put_line('hours: '||l_vaca_hrs); END LOOP; dbms_output.put_line('Asg id: '||i.assignment_id||' Payroll_id: '||i.payroll_ id||' location_id: '||i.location_id||' Total hours: '||l_total_hrs);

-- clear variables l_vaca_hrs l_total_hrs l_start_date l_end_date l_accrual_end_date l_accrual END LOOP;

:= := := := := :=

0; 0; NULL; NULL; NULL; 0;

EXCEPTION WHEN others THEN dbms_output.put_line(SUBSTR(SQLERRM,1,254)); END; / undefine assignment_id; ---------=========== Download a Concurrent Program to file (from the command line): ---------------------------------------------------------------------------------- acfprog.lct copies a program. -- table FND_APPLICATION.application_short_name has the short name you will need . $FND_TOP/bin/FNDLOAD apps/apps@DB_INSTANCE 0 Y DOWNLOAD $FND_TOP/admin/import/af cpprog.lct WORLDS_BEST_PROGRAM.ldt PROGRAM APPLICATION_SHORT_NAME='JPAY' CONCURR ENT_PROGRAM_NAME='WORLDS_BEST_PROGRAM' Upload the Concurrent Program: ---------------------------------------------------------------------------------- you can sepcify a different database with the credentials; -- just use different value for DB_INSTANCE $FND_TOP/bin/FNDLOAD apps/apps@DB_INSTANCE 0 Y UPLOAD $FND_TOP/patch/115/import/ afcpprog.lct WORLDS_BEST_PROGRAM.ldt Download a Value Set: --------------------------------------------------------------------------------$FND_TOP/bin/FNDLOAD apps/apps@DB_INSTANCE 0 Y DOWNLOAD @FND:admin/import/affflo ad.lct BEST_VALUE_SET.ldt VALUE_SET FLEX_VALUE_SET_NAME='BEST_VALUE_SET' Download Value Set Values: --------------------------------------------------------------------------------$FND_TOP/bin/FNDLOAD apps/apps@DB_INSTANCE 0 Y DOWNLOAD @FND:admin/import/affflo ad.lct BEST_VALUE_SET.ldt VALUE_SET_VALUE FLEX_VALUE_SET_NAME='BEST_VALUE_SET' Upload a Value Set: --------------------------------------------------------------------------------$FND_TOP/bin/FNDLOAD apps/apps@DB_INSTANCE 0 Y UPLOAD $FND_TOP/patch/115/import/

afffload.lct BEST_VALUE_SET.ldt ---------=========== Obtain Oracle Self-Service Framework Information about your installation by browsing to this link: http://<HostName>:<Port#>/OA_HTML/OAInfo.jsp ---------=========== --- PYUPIP is a utility to trace the execution -- of Oracle standard code. Turning it on will -- generate trace files as code is executed. -- Helpful in debugging APIs. --- Note: This will expose the apps password -- to 'ps' command on HP-UX. --- Source: Note:260683.1 -- Location of the script: $PER_TOP/patch/115/sql/ - Steps for monitoring the pipe using PYUPIP : SQL SCRIPTS from SQL PROMPT: 1. Start a UNIX session (we will call it window 1) and log into SQL*Plus as /@. Get the SQL*Plus session id by executing the following SQL statement: SELECT userenv('sessionid') FROM dual; It will return something like: 7212808 (note the session id) 2. Start another UNIX session (we will call it window 2). Make sure that you are in a directory that you have write privileges to, and there is plenty of disk space. Using the returned from window 1, enter the following at the UNIX prompt: $PAY_TOP/bin/PYUPIP /@ > PYUPIP.txt PYUPIP.txt can be named anything you want it to be. This is the file that will contain the trace file of the PL/SQL execution. 3. To turn the trace on , from window 1, execute the following command: exec hr_utility.trace_on; 4. Run the SQL script in window 1 that you are trying to produce a trace for. As the script runs, data will be outputted to PYUPIP.txt. After executing the command to run the SQL script, you will not see anything

on this screen immediately. Since everything is being written to PYUPIP.txt, there will be no screen output. So please be patient and wait for the SQL*Plus session to return back to the SQL> prompt. 5. After the script has finished running, execute the following command in window 2: Break the trace by entering -C that is (control key) C. Your trace is now recorded in the file PYUPIP.txt ---------=========== un an FRD Trace: http://<machine.domain>:<port>/dev60cgi/f60cgi?record=collect&log=<path_to_logfi le>/oracle.FRD.log

---------=========== ----------

You might also like