How to write CLOB parameter in a file or XML using shell script?
I executed a oracle stored procedure using shell script. How can i get the OUT parameter of the procedure(CLOB) and write it in a file or XML in UNIX environment using shell script?
Edit/Delete Message
SQL> var c clob
SQL>
SQL> begin
2 select
3 DBMS_XMLGEN.getXML(
4 'select rownum, object_type, object_name from user_objects where rownum <= 5'
5 ) into :c
6 from dual;
7 end;
8 /
PL/SQL procedure successfully completed.
SQL>
SQL> set long 999999
SQL> set heading off
SQL> set pages 0
SQL> set feedback off
SQL> set termout off
SQL> set trimspool on
// following in the script is not echo'ed to screen
set echo off
spool /tmp/x.xml
select :c from dual;
spool off
SQL>
SQL> --// file size
SQL> !ls -l /tmp/x.xml
-rw-rw-r-- 1 billy billy 583 2011-12-22 13:35 /tmp/x.xml
SQL> --// file content
SQL> !cat /tmp/x.xml
<?xml version="1.0"?>
<ROWSET>
<ROW>
<ROWNUM>1</ROWNUM>
<OBJECT_TYPE>TABLE</OBJECT_TYPE>
<OBJECT_NAME>BONUS</OBJECT_NAME>
</ROW>
<ROW>
<ROWNUM>2</ROWNUM>
<OBJECT_TYPE>PROCEDURE</OBJECT_TYPE>
<OBJECT_NAME>CLOSEREFCURSOR</OBJECT_NAME>
</ROW>
<ROW>
<ROWNUM>3</ROWNUM>
<OBJECT_TYPE>TABLE</OBJECT_TYPE>
<OBJECT_NAME>DEPT</OBJECT_NAME>
</ROW>
<ROW>
<ROWNUM>4</ROWNUM>
<OBJECT_TYPE>TABLE</OBJECT_TYPE>
<OBJECT_NAME>EMP</OBJECT_NAME>
</ROW>
<ROW>
<ROWNUM>5</ROWNUM>
<OBJECT_TYPE>TABLE</OBJECT_TYPE>
<OBJECT_NAME>EMPTAB</OBJECT_NAME>
</ROW>
</ROWSET>
SQL>
Similar Messages
-
Moving files into directory using shell script
Can someone tell me how I move files into directory using *nix/linux shell script?
I have files which created from stored procedures using utl_file. The files name for example:
DKH_104_12345
DKE_101_42324242
DKH_102_32432
DKE_101_34553
Then I create directories automatically for example:
/oradata/apps/dmp/output/101
/oradata/apps/dmp/output/102
/oradata/apps/dmp/output/103
/oradata/apps/dmp/output/104
Using this procedure :
CREATE OR REPLACE PROCEDURE Xorganize AS
v_item VARCHAR2(5);
v_DirName VARCHAR2(50);
v_FileName VARCHAR2(50):='xorganize';
v_FileExt VARCHAR2(5):='.sh';
v_ID UTL_FILE.file_type;
CURSOR res IS
--find the directory name from table
SELECT brn_cde FROM vcr_brn_cde ORDER BY 1;
BEGIN
--used by utl.file funtion
SELECT PRD_DIR INTO v_DirName
FROM CR_SYS_PRM
WHERE CLT_CDE ='FIF';
SELECT v_FileName||v_FileExt INTO v_FileName FROM dual;
v_ID:=UTL_FILE.FOPEN(v_DirName,v_FileName, 'w');
utl_file.PUTF(v_ID,'%s\n','@@echo OFF');
utl_file.PUTF(v_ID,'%s\n','cls');
utl_file.PUTF(v_ID,'%s\n','echo Reorganizing ...');
OPEN res;
LOOP
FETCH res INTO v_item;
EXIT WHEN res%NOTFOUND;
utl_file.PUTF(v_ID,'%s\n','mkdir '||v_item);
END LOOP;
CLOSE res;
OPEN res;
LOOP
FETCH res INTO v_item;
EXIT WHEN res%NOTFOUND;
utl_file.PUTF(v_ID,'%s\n','move _'||v_item||'_.* '||v_item||'\');
END LOOP;
CLOSE res;
utl_file.PUTF(v_ID,'%s\n','FOR /F "usebackq delims=" %%1 IN (`dir /b *.`) DO @rd/q %%1');
utl_file.PUTF(v_ID,'%s\n','cls');
utl_file.PUTF(v_ID,'%s\n','echo Reorganizing ...Done');
utl_file.fclose(v_ID);
END;
Everything works fine, BUT, the script is generated in dos/windows scripting.
Now I need to run the script in *nix/linux shell, which I still can’t do it (because of my knowledge :p).
And also I don’t know if the script already generated in *nix/linux shell version, how do I chmod +x the script from stored procedure, I can’t use ‘host’ command in my tools
Thanks a lot
-firmanIf you're using 9i then UTL_FILE.FRENAME() will execute something like a Unix mv command.
If you want to do a chmod then you'll need to check out how to use a Java Stored Procedure to execute OS calls.
Cheers, APC -
Generating Text file from table using Shell script
I am using KSH for generating and FTPing a text file from a table.
While generating Text file I am not getting my Column names in orderly manner.
q2="select COLUMN1||' '||COLUMN2||' '||COLUMN3 from table1;"
set pagesize 0
set head off
set trimspool on
set trimout on
set colsep ' '
set linesize 1500
set trimspool on
spool /ss/app11/oastss/reports/$file2
select 'COLUMN1'||' '||'COLUMN2'||' '||'COLUMN3' from dual;
$q2
spool off;
EOF
I am getting the result some what like below in text file
COLUMN1 COLUMN2 COLUMN3
MALLIK_ACCT 17-SEP-11 908030482
MALLIK_ACCT 17-SEP-11 908266967
MALLIK_ACCT 17-SEP-11 909570766
I want the format like below
COLUMN1........ COLUMN2 .... COLUMN3
MALLIK_ACCT ...17-SEP-11 .... 908030482
MALLIK_ACCT ...17-SEP-11 .... 908266967
MALLIK_ACCT ...17-SEP-11 .... 909570766
I put dots(.) for illustration purpose.
column data length may icrease some times . it shoudl automatically adjust column and data so that they are in alignment. thanks in advance.Mallik wrote:
Hi my question is to format the headers so that they will be in alignment with column data and readable.So you want to output a query as a fixed width format data file? How about this (rather than using scripts)...
As sys user:
CREATE OR REPLACE DIRECTORY TEST_DIR AS '\tmp\myfiles'
GRANT READ, WRITE ON DIRECTORY TEST_DIR TO myuser
/As myuser:
CREATE OR REPLACE PROCEDURE run_query(p_sql IN VARCHAR2
,p_dir IN VARCHAR2
,p_header_file IN VARCHAR2
,p_data_file IN VARCHAR2 := NULL) IS
v_finaltxt VARCHAR2(4000);
v_v_val VARCHAR2(4000);
v_n_val NUMBER;
v_d_val DATE;
v_ret NUMBER;
c NUMBER;
d NUMBER;
col_cnt INTEGER;
f BOOLEAN;
rec_tab DBMS_SQL.DESC_TAB;
col_num NUMBER;
v_fh UTL_FILE.FILE_TYPE;
v_samefile BOOLEAN := (NVL(p_data_file,p_header_file) = p_header_file);
BEGIN
c := DBMS_SQL.OPEN_CURSOR;
DBMS_SQL.PARSE(c, p_sql, DBMS_SQL.NATIVE);
d := DBMS_SQL.EXECUTE(c);
DBMS_SQL.DESCRIBE_COLUMNS(c, col_cnt, rec_tab);
FOR j in 1..col_cnt
LOOP
CASE rec_tab(j).col_type
WHEN 1 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_v_val,2000);
WHEN 2 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_n_val);
WHEN 12 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_d_val);
ELSE
DBMS_SQL.DEFINE_COLUMN(c,j,v_v_val,2000);
END CASE;
END LOOP;
-- This part outputs the HEADER
v_fh := UTL_FILE.FOPEN(upper(p_dir),p_header_file,'w',32767);
FOR j in 1..col_cnt
LOOP
CASE rec_tab(j).col_type
WHEN 1 THEN v_finaltxt := v_finaltxt||rpad(lower(rec_tab(j).col_name),rec_tab(j).col_max_len,' ');
WHEN 2 THEN v_finaltxt := v_finaltxt||rpad(lower(rec_tab(j).col_name),rec_tab(j).col_max_len,' ');
WHEN 12 THEN v_finaltxt := v_finaltxt||rpad(lower(rec_tab(j).col_name),greatest(19,length(rec_tab(j).col_name)),' ');
END CASE;
END LOOP;
UTL_FILE.PUT_LINE(v_fh, v_finaltxt);
IF NOT v_samefile THEN
UTL_FILE.FCLOSE(v_fh);
END IF;
-- This part outputs the DATA
IF NOT v_samefile THEN
v_fh := UTL_FILE.FOPEN(upper(p_dir),p_data_file,'w',32767);
END IF;
LOOP
v_ret := DBMS_SQL.FETCH_ROWS(c);
EXIT WHEN v_ret = 0;
v_finaltxt := NULL;
FOR j in 1..col_cnt
LOOP
CASE rec_tab(j).col_type
WHEN 1 THEN DBMS_SQL.COLUMN_VALUE(c,j,v_v_val);
v_finaltxt := v_finaltxt||rpad(nvl(v_v_val,' '),rec_tab(j).col_max_len,' ');
WHEN 2 THEN DBMS_SQL.COLUMN_VALUE(c,j,v_n_val);
v_finaltxt := v_finaltxt||rpad(nvl(to_char(v_n_val,'fm99999999999999999999999999999999999999'),' '),rec_tab(j).col_max_len,' ');
WHEN 12 THEN DBMS_SQL.COLUMN_VALUE(c,j,v_d_val);
v_finaltxt := v_finaltxt||rpad(nvl(to_char(v_d_val,'DD/MM/YYYY HH24:MI:SS'),' '),greatest(19,length(rec_tab(j).col_name)),' ');
END CASE;
END LOOP;
UTL_FILE.PUT_LINE(v_fh, v_finaltxt);
END LOOP;
UTL_FILE.FCLOSE(v_fh);
DBMS_SQL.CLOSE_CURSOR(c);
END;This allows for the header row and the data to be written to seperate files if required.
e.g.
SQL> exec run_query('select * from emp','TEST_DIR','output.txt');
PL/SQL procedure successfully completed.Output.csv file contains:
empno ename job mgr hiredate sal comm deptno
7369 SMITH CLERK 7902 17/12/1980 00:00:00800 20
7499 ALLEN SALESMAN 7698 20/02/1981 00:00:001600 300 30
7521 WARD SALESMAN 7698 22/02/1981 00:00:001250 500 30
7566 JONES MANAGER 7839 02/04/1981 00:00:002975 20
7654 MARTIN SALESMAN 7698 28/09/1981 00:00:001250 1400 30
7698 BLAKE MANAGER 7839 01/05/1981 00:00:002850 30
7782 CLARK MANAGER 7839 09/06/1981 00:00:002450 10
7788 SCOTT ANALYST 7566 19/04/1987 00:00:003000 20
7839 KING PRESIDENT 17/11/1981 00:00:005000 10
7844 TURNER SALESMAN 7698 08/09/1981 00:00:001500 0 30
7876 ADAMS CLERK 7788 23/05/1987 00:00:001100 20
7900 JAMES CLERK 7698 03/12/1981 00:00:00950 30
7902 FORD ANALYST 7566 03/12/1981 00:00:003000 20
7934 MILLER CLERK 7782 23/01/1982 00:00:001300 10
The procedure allows for the header and data to go to seperate files if required. Just specifying the "header" filename will put the header and data in the one file.
Adapt to output different datatypes and styles are required (this is currently coded for VARCHAR2, NUMBER and DATE) -
Remote deploy a war file in weblogic using ant script
Hi,
How do I remote deploy a war file in weblogic using ant script
Thankshttp://download.oracle.com/docs/cd/E13222_01/wls/docs100/programming/wldeploy.html
-
How to write sql command in batch file
hi,
i m using oracle 9i on windows. i want to know how can i write sql command on batch file. i want to use a batch file to use sql command like shutdowm & startup command and any select command too.
so plz tell how can i do it ?
thxssuperdba wrote:
thxs u all , i got it at i wanted to do.
thaks u all for yr precious time.
thxsYou've 67 questions with 63 UNanswered. Please mark this question as "answered" and give points to the users whose answer you accept as "helpful" or "correct"
Kamran Agayev A. (10g OCP)
http://kamranagayev.wordpress.com
[Step by Step install Oracle on Linux and Automate the installation using Shell Script |http://kamranagayev.wordpress.com/2009/05/01/step-by-step-installing-oracle-database-10g-release-2-on-linux-centos-and-automate-the-installation-using-linux-shell-script/] -
How to write new line to a File?
How to write new line to a file?
I have a string to be written to a file. the string contains "\n" in it. But why it is not showing the new line in the file.
I have tryed FileWriter class and FileOutputStream class, but none of them works?
any suggestion please...Probably using PrintStream::println() is a portable way.
import java.io.FileOutputStream;
import java.io.PrintStream;
public class NewLine {
public static void main(String[] args) {
try {
PrintStream ps = new PrintStream(new FileOutputStream("foo.txt"));
ps.write("string".getBytes());
ps.println();
ps.close();
} catch (java.io.IOException e) {
e.printStackTrace();
}Regards, -
How to get ORA errors in alertlog file using shell script.
Hi,
Can anyone tell me how to get all ORA errors between two particular times in an alertlog file using shell script.
ThanksHi,
You can define the alert log as an external table, and extract messages with SQL, very cool:
http://www.dba-oracle.com/t_oracle_alert_log_sql_external_tables.htm
If you want to write a shell script to scan the alert log, see here:
http://www.rampant-books.com/book_2007_1_shell_scripting.htm
#!/bin/ksh
# log monitoring script
# report all errors (and specific warnings) in the alert log
# which have occurred since the date
# and time in last_alerttime_$ORACLE_SID.txt
# parameters:
# 1) ORACLE_SID
# 2) optional alert exclusion file [default = alert_logmon.excl]
# exclude file format:
# error_number error_number
# error_number ...
# i.e. a string of numbers with the ORA- and any leading zeroes that appear
# e.g. (NB the examples are NOT normally excluded)
# ORA-07552 ORA-08006 ORA-12819
# ORA-01555 ORA-07553
BASEDIR=$(dirname $0)
if [ $# -lt 1 ]; then
echo "usage: $(basename) ORACLE_SID [exclude file]"
exit -1
fi
export ORACLE_SID=$1
if [ ! -z "$2" ]; then
EXCLFILE=$2
else
EXCLFILE=$BASEDIR/alert_logmon.excl
fi
LASTALERT=$BASEDIR/last_alerttime_$ORACLE_SID.txt
if [ ! -f $EXCLFILE ]; then
echo "alert exclusion ($EXCLFILE) file not found!"
exit -1
fi
# establish alert file location
export ORAENV_ASK=NO
export PATH=$PATH:/usr/local/bin
. oraenv
DPATH=`sqlplus -s "/ as sysdba" <<!EOF
set pages 0
set lines 160
set verify off
set feedback off
select replace(value,'?','$ORACLE_HOME')
from v\\\$parameter
where name = 'background_dump_dest';
!EOF
`
if [ ! -d "$DPATH" ]; then
echo "Script Error - bdump path found as $DPATH"
exit -1
fi
ALOG=${DPATH}/alert_${ORACLE_SID}.log
# now create awk file
cat > $BASEDIR/awkfile.awk<<!EOF
BEGIN {
# first get excluded error list
excldata="";
while (getline < "$EXCLFILE" > 0)
{ excldata=excldata " " \$0; }
print excldata
# get time of last error
if (getline < "$LASTALERT" < 1)
{ olddate = "00000000 00:00:00" }
else
{ olddate=\$0; }
errct = 0; errfound = 0;
{ if ( \$0 ~ /Sun/ || /Mon/ || /Tue/ || /Wed/ || /Thu/ || /Fri/ || /Sat/ )
{ if (dtconv(\$3, \$2, \$5, \$4) <= olddate)
{ # get next record from file
next; # get next record from file
# here we are now processing errors
OLDLINE=\$0; # store date, possibly of error, or else to be discarded
while (getline > 0)
{ if (\$0 ~ /Sun/ || /Mon/ || /Tue/ || /Wed/ || /Thu/ || /Fri/ || /Sat/ )
{ if (errfound > 0)
{ printf ("%s<BR>",OLDLINE); }
OLDLINE = \$0; # no error, clear and start again
errfound = 0;
# save the date for next run
olddate = dtconv(\$3, \$2, \$5, \$4);
continue;
OLDLINE = sprintf("%s<BR>%s",OLDLINE,\$0);
if ( \$0 ~ /ORA-/ || /[Ff]uzzy/ )
{ # extract the error
errloc=index(\$0,"ORA-")
if (errloc > 0)
{ oraerr=substr(\$0,errloc);
if (index(oraerr,":") < 1)
{ oraloc2=index(oraerr," ") }
else
{ oraloc2=index(oraerr,":") }
oraloc2=oraloc2-1;
oraerr=substr(oraerr,1,oraloc2);
if (index(excldata,oraerr) < 1)
{ errfound = errfound +1; }
else # treat fuzzy as errors
{ errfound = errfound +1; }
END {
if (errfound > 0)
{ printf ("%s<BR>",OLDLINE); }
print olddate > "$LASTALERT";
function dtconv (dd, mon, yyyy, tim, sortdate) {
mth=index("JanFebMarAprMayJunJulAugSepOctNovDec",mon);
if (mth < 1)
{ return "00000000 00:00:00" };
# now get month number - make to complete multiple of three and divide
mth=(mth+2)/3;
sortdate=sprintf("%04d%02d%02d %s",yyyy,mth,dd,tim);
return sortdate;
!EOF
ERRMESS=$(nawk -f $BASEDIR/awkfile.awk $ALOG)
ERRCT=$(echo $ERRMESS|awk 'BEGIN {RS="<BR>"} END {print NR}')
rm $LASTALERT
if [ $ERRCT -gt 1 ]; then
echo "$ERRCT Errors Found \n"
echo "$ERRMESS"|nawk 'BEGIN {FS="<BR>"}{for (i=1;NF>=i;i++) {print $i}}'
exit 2
fi -
How to load other obejects in flash file after intro using ActionScript 3.0
How to load other obejects in flash file after intro using ActionScript 3.0 or any other method all in same fla file. see blow intro screen shot ,this one playing repeatedly without loading other fla pages .only way to load other pages is click on Skip intro .see second screeshot below .i need that site to load after intro .
see codes already in
stop();
skipintro_b.addEventListener(MouseEvent.CLICK, skipintro_b_clicked);
function skipintro_b_clicked(e:MouseEvent):void{
gotoAndStop("whoweare");
There is another script there
/* Simple Timer
Displays a countdown timer in the Output panel until 30 seconds elapse.
This code is a good place to start for creating timers for your own purposes.
Instructions:
1. To change the number of seconds in the timer, change the value 30 in the first line below to the number of seconds you want.
var fl_TimerInstance:Timer = new Timer(1000, 30);
fl_TimerInstance.addEventListener(TimerEvent.TIMER, fl_TimerHandler);
fl_TimerInstance.start();
var fl_SecondsElapsed:Number = 1;
function fl_TimerHandler(event:TimerEvent):void
trace("Seconds elapsed: " + fl_SecondsElapsed);
fl_SecondsElapsed++;
i have no knowledge about these thing ,any help really appreciated .Ned Murphy Thank you very Much .It is working .Great advice
-
How to trace changes in directories and files in windows using java.
Hi,
Want to know how to trace changes in directories and files in windows using java.
I need to create a java procedure that keeps track of any changes done in any directory and its files on a windows System and save this data.
Edited by: shruti.ggn on Mar 20, 2009 1:56 AMchk out the bellow list,get the xml and make the procedure.....
Notes
1 Some of the similar softwares include HoneyBow, honeytrap, honeyC, captureHPC, honeymole, captureBAT, nepenthes.
2 Some of the other hacking softwares include keyloggers. Keyloggers are used for monitoring the keystrokes typed by the user so that we can get the info or passwords one is typing. Some of the keyloggers include remote monitoring capability, it means that we can send the remote file across the network to someone else and then we can monitor the key strokes of that remote pc. Some of the famous keyloggers include win-spy, real-spy, family keylogger and stealth spy.
3 Apart from theses tools mentioned above there are some more tools to include that are deepfreeze, Elcomsoft password cracking tools, Online DFS, StegAlyzer, Log analysis tools such as sawmill, etc. -
Convertion of flat file to XML using DOM
Hi!
I need help for convert a flat file to XML using DOM and by taking the validation of a specified DTD. Can any body help me in this regard.
Bye,
latfirst you have to decide how the flat file will map to xml. Will you use attributes or pcdata for your fields, or both? Will there be a hierarchy, or will it be mostly flat?
Once decided, you'd probably just use a BufferedReader to read the lines one at a time, and generate Dom nodes as appropriate, and stick them in the tree. -
Make .dmp file using shell script
i am new in linux.
i want to make .dmp file(export form a table) in a particular directory using shell script .
then form .dmp file i want to convert it in .zip file
Edited by: 855516 on Jul 18, 2011 5:26 PMThe following should give you a head start:
Create the following file i.e. scott_export.sh
#!/bin/bash
MAILADR="[email protected]"
EXPDIR="/home/oracle/datapump"
EXPDIR4SQL="'$EXPDIR'"
DUMPFILE="export_`date +%N`.dmp"
LOGFILE="export_`date +%N`.log"
ORACLE_SID=test; export ORACLE_SID
PATH=$PATH:/usr/local/bin; export PATH
ORAENV_ASK=NO
. /usr/local/bin/oraenv
mkdir -p $EXPIDR 2>/dev/null
sqlplus -s /nolog <<EOF
connect / as sysdba
set pages 0 feed off
create or replace directory datapump as $EXPDIR4SQL;
grant read, write on directory datapump to scott;
exit
EOF
expdp scott/tiger tables=EMP,DEPT \
transport_full_check=y \
directory=datapump dumpfile=$DUMPFILE logfile=$LOGFILE
gzip $EXPDIR/$DUMPFILE >> $EXPDIR/$LOGFILE
cat $EXPDIR/$LOGFILE | mailx -s "$LOGFILE" $MAILADR
# ENDGive execute privileges:
$ chmod 750 scott_export.sh
The above script should also work as a cron job. -
how to run 3 job(a,b,c) parallel in unix shells script and after will complete d will start and we have to handle the error also
032ee1bf-8007-4d76-930e-f77ec0dc7e54 wrote:
how to run 3 job(a,b,c) parallel in unix shells script and after will complete d will start and we have to handle the error also
Please don't overwhelm us with so many details!
Just off the top of my head ... as a general approach ... something like
nohup proca
nohup procb
nohup procc
while (some condition checking that all three procs are still running ... maybe a ps -ef |grep )
do
sleep 2
done
procd
But, we'd really need to know what it is you are really trying to accomplish, instead of your pre-conceived solution. -
How to Email Concurrent Program Output to Email using Shell Script
Hi All,
Have a Nice Day,
I have a tricky requirement and i was not able to achieve, let me explain my requirement
I have created a PLSQL Concurrent Program named "Approval Update". This will do update and it display the number of rows updated.
Now i need to take this concurrent program output and it needs to be send it to the person who submits this program as an email using shell scripts.
I have referred meta link note as well as some OTN posts but I was not able to achieve this.
Please help me to complete this As soon as possible, Thanks in advance for your help.
Let me know if you need more clarifications.
Regards,
CSKI don't have much idea in shell scripts all i want is, in my shell script i need to get the parent concurrent program output and that needs to be emailed to the intended person.
Please help to to get the shell script commands for this.I do not have any shell script to share, sorry! If you want the query to get the parent request_id so you can get the log/out file name/location from then please refer to:
REQUESTS.sql Script for Parent/Child Request IDs and Trace File IDs [ID 280295.1]
http://etrm.oracle.com/pls/et1211d9/etrm_pnav.show_object?c_name=FND_CONC_REQ_SUMMARY_V&c_owner=APPS&c_type=VIEW
http://etrm.oracle.com/pls/et1211d9/etrm_pnav.show_object?c_name=FND_CONCURRENT_REQUESTS&c_owner=APPLSYS&c_type=TABLE -- LOGFILE_NAME & OUTFILE_NAME
Thanks,
Hussein -
How to submit request(Report+Template) using Shell Scripts?
Hi Friends,
How to submit request + Add layout using shell scripts..
If anybody has sample code..Can you please send me to [email protected]
Please help me..
Its Urgent.
Thanks and Regards,
A Swain
Message was edited by:
SwainAFollowing is a package where the request is submitted and the layout is added.
Also check iin the other way by adding the layout first n then giving the request.
CREATE OR REPLACE PACKAGE BODY try
AS
PROCEDURE try_proc
errbuf OUT VARCHAR2,
retcode OUT NUMBER
IS
l_mode BOOLEAN;
l_request_id NUMBER;
xml_layout BOOLEAN;
BEGIN
fnd_file.put_line (fnd_file.output, 'USER_ID :' || fnd_global.user_id);
fnd_file.put_line (fnd_file.output, 'REQU_ID :' || fnd_global.resp_id);
fnd_file.put_line (fnd_file.output,
'RESP_APPL_ID :' || fnd_global.resp_appl_id
l_mode := fnd_request.set_mode (db_trigger => TRUE);
IF l_mode IS NOT NULL
THEN
fnd_file.put_line (fnd_file.output,
'Concurrent MODE Option is Success'
END IF;
-- if wrong paramters error recd give all 100 arguments as null
l_request_id :=
fnd_request.submit_request (application => 'app_short_name',
program => 'shortname',
sub_request => FALSE
fnd_file.put_line (fnd_file.output,
'Request_Id 1 is :' || l_request_id
xml_layout :=
fnd_request.add_layout (template_appl_name => 'SQLAP',
template_code => 'CAPINEF01',
template_language => 'en',
template_territory => 'US',
output_format => 'PDF'
COMMIT;
EXCEPTION
WHEN OTHERS
THEN
fnd_file.put_line (fnd_file.LOG,
'Error in procedure package procedure :'
|| SUBSTR (SQLCODE, 1, 20)
|| ':'
|| SUBSTR (SQLERRM, 1, 250)
END try_proc;
END try; -
Delete backup files using shell script
Hi Gurus,
I have to delete previous month backupfiles like sample.ttp-04-24-06 file from directory called 0424. Like that I need to delete the whole month files by using shell script.
Please I will run this script once in a month. So it will delete all previous month's backup files which are available in the date directory of that month(0401,0402,0403 etc).
Please help me out to solve this issue.
Thanks in advance.Hi Fish,
Its working fine. Thanks a lot for your excellent idea to solve my issue.
Thanks again.
bye,
Peter.
Maybe you are looking for
-
2011 Macbook Pro w/ MiniDisplayPort to HDMI, NO SOUND?
Hey guys, I am having problems setting up my 2011 MacBook Pro to my tv via the MiniDisplayPort. The visuals are transferred great and I can see everything shows up fine but the sound still plays back through my MacBook Pro speakers. I have tried go
-
Passing values to a ProgrammaticSkin
I it possible to pass values to a programmatic skin? I want to customise the apperance of a button based upon a value, for example in the code below (used to create a custom button) I would like the id value to influence how the skin is drawn. pu
-
Embeding Uploaded PDF Static Files - Problems
Good morning all. I have an application where users enter details and need to read through a selection of documents depending on what details they entered. I have uploaded 5 documents to my Apex server and used the following code to embed them inline
-
Load swf into movieclip // play pause buttons
I am going out of my mind trying to get this to work. I can do it in AS2 without a hitch - but not AS3. I just need to load an external swf file into an empty movieclip. Then I have 2 buttons play and pause that need to be on the top layer of the new
-
How to add PCI 7340 and UMI in my labview program from functions palette or how?
Am using PCI 7340 and UMI7764 for motion control of a stepper motor. How to add the functions for PCI and UMI in my labVIEW program and how do I use these further? I need to control the direction of stepper motor rotation based on the pressure applie