- SELECT
- fcpl.user_concurrent_program_name "Concurrent Program Name",
- fcp.concurrent_program_name "Short Name",
- fdfcuv.column_seq_num "Column Seq Number",
- fdfcuv.end_user_column_name "Parameter Name",
- fdfcuv.form_left_prompt "Prompt",
- fdfcuv.enabled_flag " Enabled Flag",
- fdfcuv.required_flag "Required Flag",
- fdfcuv.display_flag "Display Flag",
- fdfcuv.flex_value_set_id "Value Set Id",
- ffvs.flex_value_set_name "Value Set Name",
- flv.meaning "Default Type",
- fdfcuv.DEFAULT_VALUE "Default Value"
- FROM
- fnd_concurrent_programs fcp,
- fnd_concurrent_programs_tl fcpl,
- fnd_descr_flex_col_usage_vl fdfcuv,
- fnd_flex_value_sets ffvs,
- fnd_lookup_values flv
- WHERE
- fcp.concurrent_program_id = fcpl.concurrent_program_id
- AND fcpl.user_concurrent_program_name = :conc_prg_name
- AND fdfcuv.descriptive_flexfield_name = '$SRS$.'
- || fcp.concurrent_program_name
- AND ffvs.flex_value_set_id = fdfcuv.flex_value_set_id
- AND flv.lookup_type(+) = 'FLEX_DEFAULT_TYPE'
- AND flv.lookup_code(+) = fdfcuv.default_type
- AND fcpl.LANGUAGE = USERENV ('LANG')
- AND flv.LANGUAGE(+) = USERENV ('LANG')
- ORDER BY fdfcuv.column_seq_num;
Tuesday, July 23, 2013
Query to find Parameters and Value Sets associated with a Concurrent Program
Friday, July 19, 2013
Date convert Function
Have created very useful function to convert date format.
We are using it to take the date format from user's preferences and changing it to standard format.
CREATE OR REPLACE FUNCTION APPS.XX_DATE_CONVERT (p_date_format IN VARCHAR2,
P_PROMISED_DATE VARCHAR2)
RETURN VARCHAR2
IS
p_return_promise_date VARCHAR2 (100);
BEGIN
IF p_date_format = 'MM-DD-RRRR'
THEN
p_return_promise_date :=
TO_DATE(TO_CHAR (TO_DATE (P_PROMISED_DATE, 'MM-DD-RRRR HH24:MI:SS'),
'DD-MON-RRRR'));
ELSIF p_date_format = 'DD-MM-RRRR'
THEN
p_return_promise_date :=
TO_CHAR (TO_DATE (P_PROMISED_DATE, 'DD-MM-RRRR HH24:MI:SS'),
'DD-MON-RRRR');
ELSIF p_date_format = 'MM/DD/RRRR'
THEN
p_return_promise_date :=
TO_CHAR (TO_DATE (P_PROMISED_DATE, 'MM/DD/RRRR HH24:MI:SS'),
'DD-MON-RRRR');
ELSIF p_date_format = 'MM.DD.RRRR'
THEN
p_return_promise_date :=
TO_CHAR (TO_DATE (P_PROMISED_DATE, 'MM.DD.RRRR HH24:MI:SS'),
'DD-MON-RRRR');
ELSIF p_date_format = 'DD-MON-RRRR'
THEN
p_return_promise_date :=
TO_CHAR (TO_DATE (P_PROMISED_DATE, 'DD-MON-RRRR HH24:MI:SS'),
'DD-MON-RRRR');
ELSIF p_date_format = 'DD.MM.RRRR'
THEN
p_return_promise_date :=
TO_CHAR (TO_DATE (P_PROMISED_DATE, 'DD.MM.RRRR HH24:MI:SS'),
'DD-MON-RRRR');
ELSIF p_date_format = 'DD/MM/RRRR'
THEN
p_return_promise_date :=
TO_CHAR (TO_DATE (P_PROMISED_DATE, 'DD/MM/RRRR HH24:MI:SS'),
'DD-MON-RRRR');
ELSIF p_date_format = 'DD/MON/RRRR'
THEN
p_return_promise_date :=
TO_CHAR (TO_DATE (P_PROMISED_DATE, 'DD/MON/RRRR HH24:MI:SS'),
'DD-MON-RRRR');
ELSIF p_date_format = 'DD.MON.RRRR'
THEN
p_return_promise_date :=
TO_CHAR (TO_DATE (P_PROMISED_DATE, 'DD.MON.RRRR HH24:MI:SS'),
'DD-MON-RRRR');
ELSIF p_date_format = 'RRRR-MM-DD'
THEN
p_return_promise_date :=
TO_CHAR (TO_DATE (P_PROMISED_DATE, 'RRRR-MM-DD HH24:MI:SS'),
'DD-MON-RRRR');
ELSIF p_date_format = 'RRRR-MON-DD'
THEN
p_return_promise_date :=
TO_CHAR (TO_DATE (P_PROMISED_DATE, 'RRRR-MON-DD HH24:MI:SS'),
'DD-MON-RRRR');
ELSIF p_date_format = 'RRRR/MON/DD'
THEN
p_return_promise_date :=
TO_CHAR (TO_DATE (P_PROMISED_DATE, 'RRRR/MON/DD HH24:MI:SS'),
'DD-MON-RRRR');
ELSIF p_date_format = 'RRRR/MM/DD'
THEN
p_return_promise_date :=
TO_CHAR (TO_DATE (P_PROMISED_DATE, 'RRRR/MM/DD HH24:MI:SS'),
'DD-MON-RRRR');
ELSIF p_date_format = 'RRRR.MM.DD'
THEN
p_return_promise_date :=
TO_CHAR (TO_DATE (P_PROMISED_DATE, 'RRRR.MM.DD HH24:MI:SS'),
'DD-MON-RRRR');
ELSIF p_date_format = 'RRRR.MON.DD'
THEN
p_return_promise_date :=
TO_CHAR (TO_DATE (P_PROMISED_DATE, 'RRRR.MON.DD HH24:MI:SS'),
'DD-MON-RRRR');
END IF;
RETURN p_return_promise_date;
EXCEPTION
WHEN OTHERS
THEN
raise_application_error (
-20001,
'An error was encountered - ' || SQLCODE || ' -ERROR- ' || SQLERRM
);
END;
/
This can be used like :-
XXNHR_DATE_CONVERT (fnd_profile.value('ICX_DATE_FORMAT_MASK'),:PO_SHIPMENTS.PROMISED_DATE)
We are using it to take the date format from user's preferences and changing it to standard format.
CREATE OR REPLACE FUNCTION APPS.XX_DATE_CONVERT (p_date_format IN VARCHAR2,
P_PROMISED_DATE VARCHAR2)
RETURN VARCHAR2
IS
p_return_promise_date VARCHAR2 (100);
BEGIN
IF p_date_format = 'MM-DD-RRRR'
THEN
p_return_promise_date :=
TO_DATE(TO_CHAR (TO_DATE (P_PROMISED_DATE, 'MM-DD-RRRR HH24:MI:SS'),
'DD-MON-RRRR'));
ELSIF p_date_format = 'DD-MM-RRRR'
THEN
p_return_promise_date :=
TO_CHAR (TO_DATE (P_PROMISED_DATE, 'DD-MM-RRRR HH24:MI:SS'),
'DD-MON-RRRR');
ELSIF p_date_format = 'MM/DD/RRRR'
THEN
p_return_promise_date :=
TO_CHAR (TO_DATE (P_PROMISED_DATE, 'MM/DD/RRRR HH24:MI:SS'),
'DD-MON-RRRR');
ELSIF p_date_format = 'MM.DD.RRRR'
THEN
p_return_promise_date :=
TO_CHAR (TO_DATE (P_PROMISED_DATE, 'MM.DD.RRRR HH24:MI:SS'),
'DD-MON-RRRR');
ELSIF p_date_format = 'DD-MON-RRRR'
THEN
p_return_promise_date :=
TO_CHAR (TO_DATE (P_PROMISED_DATE, 'DD-MON-RRRR HH24:MI:SS'),
'DD-MON-RRRR');
ELSIF p_date_format = 'DD.MM.RRRR'
THEN
p_return_promise_date :=
TO_CHAR (TO_DATE (P_PROMISED_DATE, 'DD.MM.RRRR HH24:MI:SS'),
'DD-MON-RRRR');
ELSIF p_date_format = 'DD/MM/RRRR'
THEN
p_return_promise_date :=
TO_CHAR (TO_DATE (P_PROMISED_DATE, 'DD/MM/RRRR HH24:MI:SS'),
'DD-MON-RRRR');
ELSIF p_date_format = 'DD/MON/RRRR'
THEN
p_return_promise_date :=
TO_CHAR (TO_DATE (P_PROMISED_DATE, 'DD/MON/RRRR HH24:MI:SS'),
'DD-MON-RRRR');
ELSIF p_date_format = 'DD.MON.RRRR'
THEN
p_return_promise_date :=
TO_CHAR (TO_DATE (P_PROMISED_DATE, 'DD.MON.RRRR HH24:MI:SS'),
'DD-MON-RRRR');
ELSIF p_date_format = 'RRRR-MM-DD'
THEN
p_return_promise_date :=
TO_CHAR (TO_DATE (P_PROMISED_DATE, 'RRRR-MM-DD HH24:MI:SS'),
'DD-MON-RRRR');
ELSIF p_date_format = 'RRRR-MON-DD'
THEN
p_return_promise_date :=
TO_CHAR (TO_DATE (P_PROMISED_DATE, 'RRRR-MON-DD HH24:MI:SS'),
'DD-MON-RRRR');
ELSIF p_date_format = 'RRRR/MON/DD'
THEN
p_return_promise_date :=
TO_CHAR (TO_DATE (P_PROMISED_DATE, 'RRRR/MON/DD HH24:MI:SS'),
'DD-MON-RRRR');
ELSIF p_date_format = 'RRRR/MM/DD'
THEN
p_return_promise_date :=
TO_CHAR (TO_DATE (P_PROMISED_DATE, 'RRRR/MM/DD HH24:MI:SS'),
'DD-MON-RRRR');
ELSIF p_date_format = 'RRRR.MM.DD'
THEN
p_return_promise_date :=
TO_CHAR (TO_DATE (P_PROMISED_DATE, 'RRRR.MM.DD HH24:MI:SS'),
'DD-MON-RRRR');
ELSIF p_date_format = 'RRRR.MON.DD'
THEN
p_return_promise_date :=
TO_CHAR (TO_DATE (P_PROMISED_DATE, 'RRRR.MON.DD HH24:MI:SS'),
'DD-MON-RRRR');
END IF;
RETURN p_return_promise_date;
EXCEPTION
WHEN OTHERS
THEN
raise_application_error (
-20001,
'An error was encountered - ' || SQLCODE || ' -ERROR- ' || SQLERRM
);
END;
/
This can be used like :-
XXNHR_DATE_CONVERT (fnd_profile.value('ICX_DATE_FORMAT_MASK'),:PO_SHIPMENTS.PROMISED_DATE)
Subscribe to:
Posts (Atom)