When switching Responsibility, forms gave error:
Oracle error -6550: ORA-06550 : line 1, column 7:
PLS-00306: wrong number or types of arguments in call to 'INIT'
ORA-06550 : line 1, column 7:
PL/SQL: Statement ignored
has been detected in fnd_global.initialize[fnd_init_sql].
I checked profile 'Initialization SQL Statement - Custom' as suggested by Doc ID 577753.1 and did see anything on Site level. But when I ran below code, I sew one at Application level (by ID 10002).
SQL> select PROFILE_OPTION_ID, LEVEL_ID, LEVEL_VALUE, PROFILE_OPTION_VALUE
from apps.fnd_profile_option_values
where profile_option_id = (
select profile_option_id from apps.fnd_profile_options
where profile_option_name = 'FND_INIT_SQL' );
PROFILE_OPTION_ID LEVEL_ID LEVEL_VALUE PROFILE_OPTION_VALUE
--------------------------- --------------- -------------------- --------------------------------
3157 10002 20004 begin my_global.init; end;
I ran a script in check R12 profile options to got the custom Application name. After I changed profile 'Initialization SQL Statement - Custom' on that Application level to null, which deletes that row from table apps.fnd_profile_option_values, the Oracle errors on forms were fixed.
Thursday, August 4, 2016
Tuesday, August 2, 2016
Run FTP and submit concurrent job by SQL
This is a SQL script to FTP get a file from a remote Windows server to database server, and then to submit an EBS concurrent job which will read that file. The database version is Oracle 11.2.0.4.
/** pre setups:
SQL> select fnd_profile.value('WIN_UPS_FILE_INFO') from dual;
FND_PROFILE.VALUE('WIN_UPS_FILE_INFO')
--------------------------------------------------------------------------------
PUL/NT_USERID passWD WIN_HOSTNAME.domain.com
SQL> select * from all_directories where directory_name = 'CUSTOM_FTPIN';
OWNER DIRECTORY_NAME DIRECTORY_PATH
--------- ----------------------- -----------------------------
SYS CUSTOM_FTPIN /path/to/ftp/in
**/
SQL> set serveroutput on
SQL> DECLARE
-- l_utl_file_handler UTL_FILE.FILE_TYPE;
l_conn UTL_TCP.connection;
l_chr_file_line varchar2(200);
l_chr_user_id varchar2(20);
l_chr_password varchar2(20);
l_chr_directory_path varchar2(200);
l_chr_server_name varchar2(40);
l_chr_file_name varchar2(20) := 'WIN07-24-2016.csv';
-- l_chr_file_name varchar2(20) := '&1';
l_request_id Number;
BEGIN
l_chr_file_line := fnd_profile.value('WIN_UPS_FILE_INFO');
select substr(l_chr_file_line,1,12) into l_chr_user_id from dual;
select substr(l_chr_file_line,14,7) into l_chr_password from dual;
select substr(l_chr_file_line,22,30) into l_chr_server_name from dual;
l_conn := ftp.login(l_chr_server_name, '21',l_chr_user_id,l_chr_password);
ftp.ascii(p_conn => l_conn);
ftp.get(p_conn => l_conn,
p_from_file => l_chr_file_name,
p_to_dir => 'CUSTOM_FTPIN',
p_to_file => l_chr_file_name);
ftp.logout(l_conn);
utl_tcp.close_all_connections;
/** commend this out for testing FTP
l_request_id := FND_REQUEST.SUBMIT_REQUEST('MYAP','MYAPUFVW','','',FALSE,''||l_chr_file_name||'',
chr(0), '', '','','',
'', '', '', '', '', '', '', '', '', '',
'', '', '', '', '', '', '', '', '', '',
'', '', '', '', '', '', '', '', '', '',
'', '', '', '', '', '', '', '', '', '',
'', '', '', '', '', '', '', '', '', '',
'', '', '', '', '', '', '', '', '', '',
'', '', '', '', '', '', '', '', '', '',
'', '', '', '', '', '', '', '', '', '',
'', '', '', '', '', '', '', '', '');
**/
commit;
END;
/
SQL>
220 Microsoft FTP Service
331 Password required for PUL/NT_USERID.
230 User logged in.
200 Type set to A.
227 Entering Passive Mode (177,79,176,170,278,170).
125 Data connection already open; Transfer starting.
226 Transfer complete.
221 Goodbye.
PL/SQL procedure successfully completed.
SQL> exit
/** pre setups:
SQL> select fnd_profile.value('WIN_UPS_FILE_INFO') from dual;
FND_PROFILE.VALUE('WIN_UPS_FILE_INFO')
--------------------------------------------------------------------------------
PUL/NT_USERID passWD WIN_HOSTNAME.domain.com
SQL> select * from all_directories where directory_name = 'CUSTOM_FTPIN';
OWNER DIRECTORY_NAME DIRECTORY_PATH
--------- ----------------------- -----------------------------
SYS CUSTOM_FTPIN /path/to/ftp/in
**/
SQL> set serveroutput on
SQL> DECLARE
-- l_utl_file_handler UTL_FILE.FILE_TYPE;
l_conn UTL_TCP.connection;
l_chr_file_line varchar2(200);
l_chr_user_id varchar2(20);
l_chr_password varchar2(20);
l_chr_directory_path varchar2(200);
l_chr_server_name varchar2(40);
l_chr_file_name varchar2(20) := 'WIN07-24-2016.csv';
-- l_chr_file_name varchar2(20) := '&1';
l_request_id Number;
BEGIN
l_chr_file_line := fnd_profile.value('WIN_UPS_FILE_INFO');
select substr(l_chr_file_line,1,12) into l_chr_user_id from dual;
select substr(l_chr_file_line,14,7) into l_chr_password from dual;
select substr(l_chr_file_line,22,30) into l_chr_server_name from dual;
l_conn := ftp.login(l_chr_server_name, '21',l_chr_user_id,l_chr_password);
ftp.ascii(p_conn => l_conn);
ftp.get(p_conn => l_conn,
p_from_file => l_chr_file_name,
p_to_dir => 'CUSTOM_FTPIN',
p_to_file => l_chr_file_name);
ftp.logout(l_conn);
utl_tcp.close_all_connections;
/** commend this out for testing FTP
l_request_id := FND_REQUEST.SUBMIT_REQUEST('MYAP','MYAPUFVW','','',FALSE,''||l_chr_file_name||'',
chr(0), '', '','','',
'', '', '', '', '', '', '', '', '', '',
'', '', '', '', '', '', '', '', '', '',
'', '', '', '', '', '', '', '', '', '',
'', '', '', '', '', '', '', '', '', '',
'', '', '', '', '', '', '', '', '', '',
'', '', '', '', '', '', '', '', '', '',
'', '', '', '', '', '', '', '', '', '',
'', '', '', '', '', '', '', '', '', '',
'', '', '', '', '', '', '', '', '');
**/
commit;
END;
/
SQL>
220 Microsoft FTP Service
331 Password required for PUL/NT_USERID.
230 User logged in.
200 Type set to A.
227 Entering Passive Mode (177,79,176,170,278,170).
125 Data connection already open; Transfer starting.
226 Transfer complete.
221 Goodbye.
PL/SQL procedure successfully completed.
SQL> exit
Subscribe to:
Posts (Atom)