Call to script from stored prcedure passing parameters
Hello,
I have a database on linux server. On the same server there is a shell script that takes 3 parameters.
Now i want to make a procedure (stored procedure) that will take 3 parameters pass and run that script with those parameters.
I had created directory object pointing to the correct directory granted all the privileges on it (i hope so).
Now i was wondering how to code procedure?
I also made a program within the database that takes 3 parameters but i do not know how to run it. I am not sure if i can use job to run the program because
this is a multi user thing and i think it wont work as expected if 2 or more users will execute it.
Anyway i was hoping i can solve this by creating procedure that will run script provided with 3 paramters i need.
I hope I am clear on what i want to do.
Please if u have any idea how to acomplish post your ideas.
Thank you!
Hello,
first i want to thank you for the reply.
1st option ... i would want not to use java or c because i do not have programming skills in those languages.
2nd option you mentioned dbms_scheduler.
If i understand correctly procedure should go like this.
I create program whitin database. Then i create a job that will run this program. And everytime i want to execute my shell script i will run the job.
Wha will happen if 2 different users will want to run script at the same time?
Thank you for your answer.
Similar Messages
-
Calling ASP script from APEX button passing Bind variable
I am looking for some examples or best form for calling asp script from apex button that will pass apex bind variable to asp script to process.
Thanks,s
BobI am surprised by the degree of no replies. I have solved this by using asp redirects such as:
Response.Redirect("test.aspx?UserName="&user)
My formulated solution contains a page with a manually built interactive report. I have a number of bind variables at the top of the reoprt where users can query the information they want based on desginated database columns for this particular report. Once they have the "manual" interactive report displaying what they want, they click a button where a asp script is called with parameters passed that calls a Java based Crystal Reports plugin with the called correspnding report displayed with passed parameters.
Works like a charm!
This solves our reporting needs without having to resort to Bi Publisher (much too expensive) and other third party applications that kinda indicate it can work with apex but provide limited help or best form for doing so.
Bob -
Calling shell script from stored procedure.
Hi Everybody,
Could anyone tell me how to call a shell script from a stored procedure.
Thanks,
VasuYou would need to write a Java stored procedure that calls out to the underlying operating system. Tom Kyte has an example of this here
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:952229840241
Make sure that you're very aware of the security implications here, however. Your commands will run as the Oracle user on the host operating system, which makes it possible that a coding error and/or an attacker could do something like delete or corrupt Oracle data files, so you'll probably want to harden the code substantially.
Justin -
Calling SAP scripts from WEBDYNPRO
Hi
We need to call SAP scripts from WebDynpro application. As per my understanding we need to do following steps
Create a new RFC function module and create sap script output in PDF format.For this
- use OPEN_FORM , by assigning TDGETOTF='X' in the Options(Structure
ITCPO).
- call function module CLOSE_FORM with option OTFDATA
- convert OTF data to PDF by using function module CONVERT_OTF_2_PDF
Now I would like to know how to display the PDF string from WebDynpro.
Please help....
Regards
SujithHi,
You can call by creating external window method.
create LINK to URL or LINK TO ACTION according to requirement, for this. write code in onaction of that.
data: iv_url type string value 'http://<server>:<port>/sap/bc/gui/sap/its/webgui?~transaction=*se38 RS38M-PROGRAMM=rsparam;DYNP_OKCODE=SHOP'.
data: api_component type ref to if_wd_component,
window_manager type ref to if_wd_window_manager,
window type ref to if_wd_window.
api_component = wd_comp_controller->wd_get_api( ).
window_manager = api_component->get_window_manager( ).
window = window_manager->create_external_window(
url = iv_url
modal = abap_false ).
window->open( ).
Cheers,
Kris. -
Calling GUI Scripting from ABAP program
Is it possible to call GUI Scripting from ABAP and thus to use GUI Scripting as an alternative to CALL TRANSACTION?
Is the class CL_JAVA_SCRIPT suitable to access GUI Scripting engine? Accessing ABAP data object would work as well in this case as i think. What SAP Logon and WAS releases are required? Is the 6.20 release sufficient for this case?
I would appreciate if somebody could post an example.Hi,
CL_JAVA_SCRIPT has nothing to do with SAPGUI Scripting.
Calling SAPGUI Scripting API from ABAP could be possible for programmes experienced with OLE automation calls from ABAP coding.
The hardest thing will be, to access the scripting engine handle as an entry point. Once you have a handle in your abap session, any api function can be invoked.
Best regards
Jens
BTW: SAP testtool eCATT does call SAPGUI-Scripting from ABAP. -
Calling Python Script from LabVIEW
Hello Everyone,
I want to call the Python script from LabVIEW.
I tried with using at the command line but i am unable to run that script file..
i have gone through LabPython but i am unable to call the scripts from there also..
If someone has an example of a VI which invokes a python script, it will be very helpful...
Thanks a lot in advance
Regards
Avniavni wrote:
I have to invoke the Script file at command prompt.
Can you descriobe your restriction(s) concerning "invoke the script at the command prompt"? There may be ways around that. -
Calling Ant script from Jdeveloper
Hello Gurus,
I am trying to call Ant script from Jdeveloper.
I am able to call it when i don't use any javac in ant script.
But as soon as i include a javac command
<javac srcdir="${src}" destdir="${build}"/>
I get below error
C:\ant\windows\svn\AntJava\Project1\build.xml:20: Unable to find a javac compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK.
It is currently set to "C:\Oracle\jdk160_24\jre"
Needless to say i already have implemented all the steps mentioned in the internet.
I have my JAVA_HOME correctly set in my PATH environment variable.
I have tools.jar in the CLASSPATH
Please give a solution from JDeveloper perspective and not a generic one as i am done with all the steps provided in internet.any one?????
-
Call TCL script from TestStend or CVI
Hi
I would like to call TCL script from TestStand or CVI.
It’s possible ? and what do I need for it ?
T.UHi,
here is a link to an example
http://zone.ni.com/devzone/explprog.nsf/6c163603265406328625682a006ed37d/e1d9dbb13c6119f786256a3000696642?OpenDocument
Hope this helps
Regards
Ray Farmer
Regards
Ray Farmer -
Not able to call sql script from shell program
Hi Gurus,
I am facing issue while calling sqlplus script from my shell program. Please find below my shell script. This program I've written and registered as for one of concurrent program
in oracle applications.
p_userid_passwd=$1
p_appl_login=$2
p_user_name=$3
p_request_id=$4
v_conc_request_id=${5}
p_to_role=${6}
p_from_role=${7}
p_subject=${8}
p_body=${9}
p_dist_list=${10}
v_request=${11}
v_file_path_name=/u01/oraspt/REQUEST
cd $APPLCSF/$APPLOUT
echo "v_conc_request_id" $v_conc_request_id
echo "p_to_role" $p_to_role
echo "p_from_role" $p_from_role
echo "p_subject" $p_subject
echo "p_body" $p_body
echo "p_dist_list" $p_dist_list
echo "v_request" $v_request
ls -l $v_request
if [ $? -ne 0 ]
then
echo "No output request generated"
else
echo "Output request generated"
fi
echo "connecting to ftp for placing out file to DB server"
echo FTP to 99.60.17.11
echo username: "oraspt"
echo pw:
ftp -i -n 99.60.17.11 << EOF2
user "oraspt" orakdk
cd $v_file_path_name
put $v_request
bye
EOF2
output=`sqlplus -s /nolog <<EOT
whenever sqlerror exit failure;
connect apps/apps
set verify off;
set serveroutput on size 120000;
DECLARE
l_errbuf varchar2(300);
l_retcode varchar2(300);
BEGIN
XXFND_SEND_MAIL.SEND_NOTIFICATIONS( errbuf => l_errbuf
, retcode => l_retcode
, p_request_id => $v_conc_request_id
, p_to_role => $p_to_role
, p_from_role => $p_from_role
, p_subject => $p_subject
, p_body => $p_body
, p_dist_list => $p_dist_list);
EXCEPTION
when others then
dbms_output.put_line('Error encountered :'||SQLERRM);
END;
EOT
`
echo "connecting to ftp for deleting output file"
echo FTP to 99.60.17.11
echo username: "oraspt"
echo pw:
ftp -i -n 99.60.17.11 << EOF2
user "oraspt" orakdk
cd $v_file_path_name
delete $v_request
bye
EOF2
echo "Deleted successfully"Output for script is as below
v_conc_request_id 451906
p_to_role DC.DKHOO
p_from_role DC.DKHOO
p_subject Receivable audit report10
p_body Please find Audit Report Attachment.
p_dist_list
v_request o451906.out
-rw-r--r-- 1 applspt dba 2368 Dec 28 15:06 o451906.out
Output request generated
connecting to ftp for placing out file to DB server
FTP to 10.60.17.11
username: oraspt
pw:
connecting to ftp for deleting output file
FTP to 10.60.17.11
username: oraspt
pw:
Deleted successfullyPlease let me know how to trigger pl/sql script.
Thanks in advance for your help.
Regards
Nagendra
Edited by: 838961 on Dec 27, 2011 11:25 PMPlease find output as suggested, I've placed set -x in script.
+ p_userid_passwd=APPS/APPS
+ p_appl_login=1110
+ p_user_name=DC.DKHOO
+ p_request_id=451949
+ v_conc_request_id=451945
+ p_to_role=DC.DKHOO
+ p_from_role=DC.DKHOO
+ p_subject=Receivabless
+ p_body=report
+ p_dist_list=
+ v_request=o451945.out
+ v_file_path_name=/u01/oraspt/REQUEST
+ cd /u01/applspt/inst/apps/SPT_nfs-stg-app1/logs/appl/conc/out
+ echo v_conc_request_id 451945
v_conc_request_id 451945
+ echo p_to_role DC.DKHOO
p_to_role DC.DKHOO
+ echo p_from_role DC.DKHOO
p_from_role DC.DKHOO
+ echo p_subject Receivabless
p_subject Receivabless
+ echo p_body report
p_body report
+ echo p_dist_list
p_dist_list
+ echo v_request o451945.out
v_request o451945.out
+ ls -l o451945.out
-rw-r--r-- 1 applspt dba 2368 Dec 28 15:54 o451945.out
+ '[' 0 -ne 0 ']'
+ echo 'Output request generated'
Output request generated
+ echo 'connecting to ftp for placing out file to DB server'
connecting to ftp for placing out file to DB server
+ echo FTP to 10.60.17.11
FTP to 10.60.17.11
+ echo username: oraspt
username: oraspt
+ echo pw:
pw:
+ ftp -i -n 10.60.17.11
++ sqlplus -s /nolog
+ output=Connected.
+ echo 'connecting to ftp for deleting output file'
connecting to ftp for deleting output file
+ echo FTP to 10.60.17.11
FTP to 10.60.17.11
+ echo username: oraspt
username: oraspt
+ echo pw:
pw:
+ ftp -i -n 10.60.17.11
+ echo 'Deleted successfully'
Deleted successfully -
Calling shell script from apex application
Please let me know if anyone has tried Calling shell script from apex application, it would be nice enough if you can share how you did it? Thanks
Hi,
Requirements
* CREATE JOB (10g Rel.1)
* CREATE EXTERNAL JOB (10g Rel.2 / 11g)
* EXECUTE on dbms_scheduler (granted to public by default)
Since Oracle 10.2.0.2 the commands are executed as user nobody.
Code:
--Create a Program for dbms_scheduler
exec DBMS_SCHEDULER.create_program('RDS2008','EXECUTABLE','c:\ WINDOWS\system32\cmd.exe /c echo 0wned >> c:\rds3.txt',0,TRUE);
--Create, execute and delete a Job for dbms_scheduler
exec DBMS_SCHEDULER.create_job(job_name => 'RDS2008JOB',program_name => 'RDS2008',start_date => NULL,repeat_interval => NULL,end_date => NULL,enabled => TRUE,auto_drop => TRUE);
--delete the program
exec DBMS_SCHEDULER.drop_program(PROGRAM_NAME => 'RDS2008');
--Purge the logfile for dbms_scheduler
exec DBMS_SCHEDULER.PURGE_LOG;
This is one way as suggested by Trent.
We can also achieve as follows.
http://www.dba-oracle.com/t_execute_shell_script_plsql_procedure.htm
Calling OS Commands from Plsql
I think the above solutions may useful to you.
Let me know if you are facing any problem.
Thanks and Regards
Maheswara -
Calling PERL script from scheduler
Hello All,
I am trying to call PERL script from dbms_scheduler which makes the database connection using DBD module to read some values to perform the operation. My scheduler job kept failing with the following error:
ORA-27369: job of type EXECUTABLE failed with exit code: No such file or directory
STANDARD_ERROR="install_driver(Oracle) failed: Can't load '/usr/lib/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/auto/DBD/Oracle/Oracle.so' for module DBD::Oracle: libclntsh.so.10.1: cannot open shared object file
It can't open libclntsh.so.10.1 file when I run the job, I guess because in job session, it creates a new shell and doesn't inherit the .profile and none of the environmental variables get set. When I run the PERL script manually it works because of all the env variables, so I put all those variables from my .profile into PERL script itself using ENV function but it still doesn't work, failed with very same error. And yes I do set LD_LIBRARY_PATH to point to $ORACLE_HOME/lib directory. Moreover, if I run the PERL script manually from a shell where I dont inherit .profile, it fails with very same error, so it is related to the environment issues but I have no idea how to fix it. I read somewhere the setting those env variable in PERL script itself doesn't help because by the time PERL get executed all the compilers are already initialized and and they don't use those environement variables anymore then. So the question is how to make it work?
I would really appreciate if someone can help me fixing this, it's gonna change my life here :)
DB Version: 10.2.0.2 (also tested on 11R2, same problem)
OS: SUSE Linux 64 bit
And here is my libclntsh file in $ORACLE_HOME/lib
$ls -l libclnt*
lrwxrwxrwx 1 epsora epsdba 52 2009-09-15 13:39 libclntsh.so -> /u01/app/epsora/product/10.2.0/lib/libclntsh.so.10.1
-rwxr-xr-- 1 epsora epsdba 20274415 2009-09-15 13:39 libclntsh.so.10.1
-rw-r----- 1 epsora epsdba 36840968 2009-09-15 13:38 libclntst10.a
Please let me know if you need more information about this setup.
Thanks
Daljit Singh
Edited by: Daljit on Jul 6, 2010 10:06 AMNothing in your post indicates that you created a directory object and granted privileges.
http://www.morganslibrary.org/reference/directories.html
did you? -
Calling javaFX script from Java program
I am trying to call JavaFX script from a simple Java program. code as follows:
import java.io.*;
import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
public class My{
public static void main(String[] args) {
ScriptEngineManager manager = new ScriptEngineManager();
ScriptEngine engine = manager.getEngineByExtension("fx");
try {
InputStreamReader reader = new InputStreamReader(My.class.getResourceAsStream("first.fx"));
engine.eval(reader);
reader.close();
} catch (Exception e) {
e.printStackTrace();
my first.fx file code is here:
import javafx.stage.Stage;
import javafx.scene.Scene;
import javafx.scene.text.Text;
import javafx.scene.text.Font;
import javafx.scene.text.TextAlignment;
Stage {
title: "My First JavaFX Sphere"
scene: Scene {
width: 250
height: 250
content: [
Text {
font: Font { size: 24 }
x: 20, y: 90
textAlignment: TextAlignment.CENTER
content:"Welcome to \nJavaFX World"
} //Text
] // content
} // Scene
} // Stage
I am not able to run My.java. runtime error as follows:
java.lang.NullpointerException
Kindly correct me, where I am wrongI am able to call .fx file from Java. Thank you all for helping me to resolve this problem
Regards,
Ritu -
Hi Experts,
Is it possible to call a script from rman.
database 9i
Recovery catalog 10g.
Ex :
connect target test/test@TEST;
connect catalog rman/rman@RMAN
@backup (where backup is a datafile backup script on unix)
I dont know if there is any other way of calling a script within an rman script.
Any ideas....
Thanks in Advance
MBOK,
I understood. The file .SQL is for SQL statements only, not for RMAN commands.
You can create a shell script on Unix named your_backup.sh on /home/oracle directory,
for example.
This shell script file (bellow) is with your rman code, like this:
#!/bin/sh
# Name: A name for the shell script
# Author: You
# Description: Executes backup for Sunday using the RMAN
# Updates:
export ORACLE_HOME=$1
export ORACLE_SID=$2
export LOG_DIR=$3
# Variables:
SCRIPT="your_backup"
data_log=`date '+%y-%m-%d_%H:%M:%S'`
logfile=${LOG_DIR}/${SCRIPT}-${data_log}.log
# Execution of script backup of rman:
$ORACLE_HOME/bin/rman <<EOF > $logfile
connect target rman/rman
connect catalog rman/rman
run{
set controlfile autobackup format for device type disk to '%F';
allocate channel d1 type disk format '/tmp/SID/df_s%s_p%p_t%t';
restore controlfile to '/PATH/ctl/cntrlTEMP.dbf' from autobackup;
replicate controlfile from '/PATH/ctl/cntrlTEMP.dbf';
sql "alter database mount";
release channel d1;
EOF
exitto you execute this script, you can do this on the unix:
[oracle@server oracle]$ /home/oracle/your_backup.sh /u01/app/oracle/product/9.2.0.1.0 devdb /home/oracleThis script is going to generate log file to you analyze.
[]´s -
Calling sql script from anonymous block
Hi
how to call an script from an anonymous block, like
declare
v_reccord_account number :=0;
begin
SELECT xx.cc INTO v_reccord_account FROM
(select count(1) cc
from accounts
group by account_id
having count(account_id) > 1
)xx
where ROWNUM=1;
if v_reccord_account <1
then
dbms_output.put_line('no duplicates');
ELSE
< here i have to call this script -- @e:/test44.SQL >
end if;
end;Hi
thanks for replying, i'm having some sql statements, i have to spool the results of those statements .. below is the content of the file i'm calling.
=================================================
whenever sqlerror exit sql.sqlcode
set serveroutput on
column fn new_value filename
select 'remove_duplicates_'||to_char(sysdate, 'yyyymmddhh24miss')||'.log' as fn from dual;
spool E:/&filename
prompt 'Checking for duplicates'
--select account_id, count(1)
--from accounts
--group by account_id
--having count(1) > 1;
prompt 'Records to be deleted'
select *
from accounts
where decode ( substr(account_id,1,3),'COG',1,0)=1
group by account_id
having count(1) > 1;
prompt ' Deleting duplicates'
delete
from accounts
where account_id in (
select account_id
from accounts
where decode ( substr(account_id,1,3),'COG',1,0)=1
group by account_id
having count(1) > 1
commit;
========================================== -
Calling JavaFX Script from JavaScript on mobile
Hi,
We are developing a application which would run on a mobile. We have to call javafxscript from javascript in this application. Is there a way to do this on a mobile application. I am able to do this for application running on browsers.
Will javafx mobile application support this Calling JavaFX Script from JavaScript?
Please share any information related to this.
Regards,
SherlynI doubt it (but I can be wrong!).
javafx.stage.AppletStageExtension is only on the desktop profile.
[Calling From JavaScript to JavaFX Script|http://javafx.com/docs/tutorials/javafx-javascript/] article states "+this functionality requires Java SE 6 Update 10 at minimum+" which seems incompatible with mobile usage.
Beside, a quick Google search hints that JavaScript support on mobile browsers is weak or inexistent (depending on browsers).
Maybe you are looking for
-
i have my mums payment details on my itunes account, but i bought a £15 itunes voucher today from the shop and put it on my phone.. but it wont let me buy any apps becouse it keeps going to my mums payment details. can someoe help me with this
-
Ipod touch 8gb wont connect to computer or itunes
My ipod touch will not connect to my computer or itunes. i have a new charger because one it came with broke. but when i try and download music the ipod wont show up. It charges but it will not show up so i can download music.? help please!
-
How can i get my video back to camera roll
hey guys recently i tried to mail a friend a video of mine ..anyway the video got to him in a greyed gif !! idk how it just did so am tryin to send it in another way the problem is i already deleted it from my camera roll when ever i open my mess
-
Can't connect apptv to my TV via Onkyo receiver
Hi guys , Here my problem Case 1 : I connected my apptv to my Sony Tivi > everything work normaly Case 2 : I connected my applv to Onkyo receiver , then from receiver to Tivi . And nothing happened , my tivi doesn't show anything Case 3 : I connected
-
Final cut pro dvd fails to share
Over the past few months Final Cut Pro Share DVD fails most of the time. I tried restarting the program and my mac to no avail. I end up moving the video to my macbook and sharing the dvd on it. I am running OX 10.9.5 Final Cut Pro 10.1.3.