APEX: How to execute Script file from APEX
Hello All,
Can anyone tell me how to execute script file from APEX?(Step by Step process)
Thanks & Regards,
Jiten Pansara
http://docs.oracle.com/cd/E23903_01/doc/doc.41/e21677/sql_rep.htm#AEUTL193
Regards,
Similar Messages
-
How can automatic save file from apex to user local directory?
how can save pdf file from apex to user local directory on button click?
>
Welcome to the forum: please read the FAQ and forum sticky threads (if you haven't done so already), and update your profile with a real handle instead of "940509".
When you have a problem you'll get a faster, more effective response by including as much relevant information as possible upfront. This should include:
<li>Full APEX version
<li>Full DB/version/edition/host OS
<li>Web server architecture (EPG, OHS or APEX listener/host OS)
<li>Browser(s) and version(s) used
<li>Theme
<li>Template(s)
<li>Region/item type(s) (making particular distinction as to whether a "report" is a standard report, an interactive report, or in fact an "updateable report" (i.e. a tabular form)
With APEX we're also fortunate to have a great resource in apex.oracle.com where we can reproduce and share problems. Reproducing things there is the best way to troubleshoot most issues, especially those relating to layout and visual formatting. If you expect a detailed answer then it's appropriate for you to take on a significant part of the effort by getting as far as possible with an example of the problem on apex.oracle.com before asking for assistance with specific issues, which we can then see at first hand.
how can save pdf file from apex to user local directory on button click?As Tony points out the ability to do so would represent a major security breach. The normal approach is to present the user with a download link that when clicked prompts them with a Save dialog in which they can select a location for the downloaded file.
What is the source of the PDF file? -
How to execute batch file from JSP
hi frens !
i wanna know how to execute batch file from my JSP.i am using exec() method to get call the batch file. but its not working ....plz help
here mine code:-
File F = new File("C:/var.bat");
try{
if (F.exists())
Runtime rt = Runtime.getRuntime();
String url=F.getAbsolutePath();
Process proc = rt.exec(url);
proc.waitFor();
proc.destroy();
catch(Exception IOEx){
System.out.println(IOEx);
}Thanks and Regards
AllwynYou might improve your chances of getting help if you do two things:
1) Explain what "not working" means.
2) ChangeSystem.out.println(IOEx); to IOEx.printStackTrace(); (in the eventhat is in fact related to "not working"). -
How to execute sql file from servlet
Hi,
I am using JSP, Servlets and Oracle 8i in my application. I want to execute .sql file from java code. Is it possible to do that,
as we execute .sql file from sql plus prompt.
Suppose I have abc.sql file and I want to execute it from java code.
If any body have the solution then pl. reply with sample code.
Thanks,
RajeshIf any body have the solution then pl. reply with
sample code.No, no, dec - s/he doesn't want the actual solution, but the full code!
/k1 -
Hi All,
I am storing the files in apex database which are uploaded through apex form. Now i want to move these files to the third party server on regular bases. Means once we stored those files in our apex database at specific time on everyday we have to move these files to google drive. How can i achieve this please do need full.
Version: apex 4.2
Regards,
Vijay JHi Vijay,
Check out the following code: https://gist.github.com/trent-/7526011
The following need to be set accordingly
g_upload_folder_id - the google folder ID (obtained from the URL) - used as a default to upload into a particular folder
g_wallet_path - the path of your oracle wallet with the trusted certificates imported
g_wallet_password - the password for the above wallet
g_redirect_uri - The procedure that has your implementation with what to do after the user accepts
g_client_id and g_client_secret - property's from your project out of your google API console
l_endpoint_url in the function authorization_code_callback - the page to go to after authorizing
This particular code is designed to use a refresh token such that once the user authorizes, the system can refresh the token whenever they need. But you can adjust this to suit your needs. I suggest reviewing the following documentation: https://developers.google.com/accounts/docs/OAuth2WebServer
So, here is what I've done. Create a button, with a dynamic action click event with the following code:
$.ajax({
url: '&OWNER..google_drive.GET_AUTHORIZATION_URL',
data: {
p_state: &APP_SESSION.
success: function(data){
window.location.href=data;
This redirects the user to the authorization page. And as you can see in the code, would run the following when authorized:
update app_users set refresh_token = (returned token); -- that is, depending on your user management design, you would need to adjust this accordingly.
Then to upload the file, I have an onsubmit process with:
declare
l_filerow apex_application_files%rowtype;
begin
select * into l_filerow
from apex_application_files
where name = :P133_ATTACH_DATA;
:P133_GOOGLE_DOC_ID := google_drive.create_file(l_filerow.blob_content, l_filerow.mime_Type, l_filerow.filename);
end;
Please also review the following post, which describes the overall process of setting up the project, wallet, acl, etc: Oracle Apex Tips: Accessing Google Data
There are probably bits of the code that need refinement, and better error checking, but hope it helps :-) -
How to execute .msi files from java program
Hi friends,
i have written a java program which invokes and thereby execute any executable files like .exe and .bat.
So its working fine with .exe and .bat files, but it is not working with .msi files.......can you please help me how can i execute .msi files as well??
public class Executeexe {
public static void main(String ar[])
try
Process p=null;
Runtime rt=Runtime.getRuntime();
p=rt.exec("D:\\mysql-essential-5.0.83-win32.msi");
p.waitFor();
catch(Exception e)
}here is the programMake sure that the command that's being exec'd works from the cmd line.
Then read this article and do what it says:
http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html
Then if you still are having problems explain what "...it is not working with .msi files..." really means, and provide a [SSCCE Example program|http://mindprod.com/jgloss/sscce.html] -
How to execute exe file from pl/sql
How to execute an exe file or an operating system command from pl/sql in oracle 9i.
If it is part of a pl/sql block, use the java suggestion. If you are not in a blck, you can use the "HOST" command. see
http://download-west.oracle.com/docs/cd/A87860_01/doc/server.817/a82950/ch2.htm#1001697 -
How to call exe files from APEX
Hi all,
How to invoke or call some exe files like word or yahoo messenger from oracle apex ?
Apex 4.2.2
DB 11g
Thanks956320 wrote:
How to invoke or call some exe files like word or yahoo messenger from oracle apex ?
Apex 4.2.2
DB 11g
Apex is a set of PL/SQL suite of packages and procedures, with tables and so on. This code is called from a web server (e.g. Apache runing mod_plsql) via standard Oracle client-server. The code executes INSIDE the database. The codes creates a HTML buffer. This buffer is read by the web server component that made the call. And send to the web (browser) client.
That is first and foremost fundamental to understand about Apex.
Within this context - where is this executable file to be loaded, with which parameters, by whom, and where, to do what exactly? -
How to execute *.BAT file from the Java Application
Hello to all.
I wants to run *.BAT file form my applicaion.
Can u give the code of that two-four line,please
Wating four your replay.
Yours Friend
Bhavin Shah.....pr = rt.exec("cmd.exe /c start " + yourProgramName)The exec() method executes the command you specify in the argument and returns a process. In this example, it's telling Windows to run "yourProgramName".
HTH -
How to execute the job from script ??
How to execute the job from script ?? i have 2 jobs A AND B . I want to execute job B from job A'S Script ?? how can i ??
Hi Kishore,
Please refer the below link for BODS Job execution using Script
Executing a job by another job in BODS 4.1 using simple script
http://scn.sap.com/community/data-services/blog/2013/12/04/executing-a-job-by-another-job-in-bods-41-using-simple-script
Steps for executing BODS job from Unix Script with user defined global parameters
http://scn.sap.com/community/data-services/blog/2013/09/02/steps-for-executing-bods-job-from-unix-script-with-user-defined-global-parameters
Executing a job using batch file
http://scn.sap.com/thread/3503338
How to add a schedule for job2 with a condition after job 1 is finished
http://scn.sap.com/message/14523514#14523514
Scheduling BODS Jobs Sequentially and Conditionally
http://scn.sap.com/docs/DOC-34648
Thanks,
Daya -
How can I rip a 10" x 10" post script file from InDesign 6, it keeps telling me "the active document uses multiple pages sizes and won't print. My page sizes are all 10" x 10"
Please post in the InDesign forums here http://forums.adobe.com/community/indesign/indesign_general. They will be able to help you.
-
Hello colleagues!
How are u?
Could you help me explain me how to send an email from Apex please?
I suposed that Apex has an option designed for this purpose.
I would thank you your prompt reply.
Best Regards.Hello Erik.
FYI this is the sytax I use to send an email in one of my pages as part of a PL/SQL process...
l_id := APEX_MAIL.SEND(p_to => v_recipient_mail
,p_from => '[email protected]'
,p_body => l_body
,p_subj => 'Issue Updated Regarding: '||INITCAP(:P203_SUBJECT)
,p_cc => v_cc_recipients
,p_replyto => '[email protected]');Please feel free to post back if you get stuck.
Regards
Simon -
Hi
I want to generate an XML file from APEX when a click button like example in bottom
and All bold number I want receive them as parameters.
<?xml version="1.0" standalone="no"?>
<!DOCTYPE labels SYSTEM "label.dtd">
<labels _FORMAT="1" >
<label _QUANTITY="*5*" >
<variable name = "OLDPRICE">*12.99*</variable>
<variable name = "NEWPRICE">*9.99*</variable>
<variable name = "SKU">*12345*</variable>
<variable name = "COLOR">*010*</variable>
</label>
</labels>
thanks
Jade
Edited by: Jade04 on May 21, 2009 12:21 PMHi Varad,
thank you for your fast answers
plaise see the bold code for save my XML file in the server, Is it correct ?
declare
v_file_name VARCHAR2 (2000) := 'Xmlfile.xml';
FILE1 UTL_FILE.FILE_TYPE;
v_dir_1 varchar2(100) := '/prod/smb/ms/dev';
L_OUTPUT_LINE VARCHAR2(400);
begin
OWA_UTIL.mime_header ('application/txt', FALSE);
htp.p('Content-Disposition:attachment;filename="'|| v_file_name|| '"');
OWA_UTIL.http_header_close;
htp.p('
<?xml version="1.0" standalone="no"?>
<!DOCTYPE labels SYSTEM "label.dtd">
<labels FORMAT="' || :p1p1 || '" >
<label _QUANTITY="'|| :p2_p2 || '" >
<variable name = "OLDPRICE">*12.99*</variable>
<variable name = "NEWPRICE">*9.99*</variable>
<variable name = "SKU">*12345*</variable>
<variable name = "COLOR">*010*</variable>
</label>
</labels>
*FILE1 := UTL_FILE.FOPEN(I don't now then file_location,Xmlfile.xml,'r');*
*LOOP*
*BEGIN*
*UTL_FILE.GET_LINE(FILE1,L_INPUT_LINE);*
*IF L_INPUT_LINE = null THEN*
*EXIT;*
*ELSE*
*UTL_FILE.fopen(<v_dir_1, Xmlfile_cop.xml, 'W')*
*END IF;*
*EXCEPTION*
*WHEN no_data_found THEN*
*exit;*
*END;*
*END LOOP*
*UTL_FILE.FCLOSE (FILE1);*
apex_application.g_unrecoverable_error:=true;
exception when others then
null;
end;
thanks.
Jade -
Executing batch file from Java stored procedure hang
Dears,
I'm using the following code to execute batch file from Java Stored procedure, which is working fine from Java IDE JDeveloper 10.1.3.4.
public static String runFile(String drive)
String result = "";
String content = "echo off\n" + "vol " + drive + ": | find /i \"Serial Number is\"";
try {
File directory = new File(drive + ":");
File file = File.createTempFile("bb1", ".bat", directory);
file.deleteOnExit();
FileWriter fw = new java.io.FileWriter(file);
fw.write(content);
fw.close();
// The next line is the command causing the problem
Process p = Runtime.getRuntime().exec("cmd.exe /c " + file.getPath());
BufferedReader input = new BufferedReader(new InputStreamReader(p.getInputStream()));
String line;
while ((line = input.readLine()) != null)
result += line;
input.close();
file.delete();
result = result.substring( result.lastIndexOf( ' ' )).trim();
} catch (Exception e) {
e.printStackTrace();
result = e.getClass().getName() + " : " + e.getMessage();
return result;
The above code is used in getting the volume of a drive on windows, something like "80EC-C230"
I gave the SYSTEM schema the required privilege to execute the code.
EXEC DBMS_JAVA.grant_permission('SYSTEM', 'java.io.FilePermission', '<<ALL FILES>>', 'read ,write, execute, delete');
EXEC DBMS_JAVA.grant_permission('SYSTEM', 'SYS:java.lang.RuntimePermission', 'writeFileDescriptor', '');
EXEC DBMS_JAVA.grant_permission('SYSTEM', 'SYS:java.lang.RuntimePermission', 'readFileDescriptor', '');
GRANT JAVAUSERPRIV TO SYSTEM;
I have used the following to load the class in Oracle 9ir2 DB:
loadjava -u [system/******@orcl|mailto:system/******@orcl] -v -resolve C:\Server\src\net\dev\Util.java
CREATE FUNCTION A1(drive IN VARCHAR2) RETURN VARCHAR2 AS LANGUAGE JAVA NAME 'net.dev.Util.a1(java.lang.String) return java.lang.String';
variable serial1 varchar2(1000);
call A1( 'C' ) into :serial1;
The problem that it hangs when I execute the call to the function (I have indicated the line causing the problem in a comment in the code).
I have seen similar problems on other forums, but no solution posted
[http://oracle.ittoolbox.com/groups/technical-functional/oracle-jdeveloper-l/run-an-exe-file-using-oracle-database-trigger-1567662]
I have posted this in JDeveloper forum ([t-853821]) but suggested to post for forum in DB.
Can anyne help?Dear Peter,
You are totally right, I got this as mistake copy paste. I'm just having a Java utility for running external files outside Oracle DB, this is the method runFile()
I'm passing it the content of script and names of file to be created on the fly and executed then deleted, sorry for the mistake in creating caller function.
The main point, how I claim that the line in code where creating external process is the problem. I have tried the code with commenting this line and it was working ok, I made this to make sure of the permission required that I need to give to the schema passing security permission problems.
The function script is running perfect if I'm executing vbs script outside Oracle using something like "cscript //NoLogo aaa1.vbs", but when I use the command line the call just never returns to me "cmd.exe /c bb1.bat".
where content of bb1.bat as follows:
echo off
vol C: | find /i "Serial Number is"
The above batch file just get the serial number of hard drive assigned when windows formatted HD.
Same code runs outside Oracle just fine, but inside Oracle doesn't return if I exectued the following:
variable serial1 varchar2(1000);
call A1( 'C' ) into :serial1;
Never returns
Thanks for tracing teh issue to that details ;) hope you coul help. -
How to upload pdf file from windows cell phone?
How to upload pdf file from windows cell phone?
You can do this in steps.. First use the built in method for uploading a file into the flows files object, Next you would copy the file out to an Oracle built directory on your UNIX box using utl_file.put_raw..
Here is a link to show you how to upload files in an APEX application [http://download.oracle.com/docs/cd/B31036_01/doc/appdev.22/b28839/up_dn_files.htm]
And here is a link to show you how to use utl_file.put_raw.. [http://psoug.org/reference/utl_file.html], item is towards the bottom of the screen..
Thank you,
Tony Miller
Webster, TX
Maybe you are looking for
-
Problem in saving project frm labview 8.5 to 8.2
i m facing problem while saving the project frm 8.5 to 8.2 while doing this i recieve message of following Vis missing 1 Teststand-ExecuteMenu Command.vi 2.Teststand-Insert Command in Menu(Execution View Manager.Vi 3.Teststand-Insertcommand in Menu (
-
How do I add a Filter to the Spaces switcher within webcenter spaces??
Hi Experts, We are on Webcenter Spaces PS3(11.1.1.4) We urgently need assistance with the following: 1. The client needs a filter that will show only the collaborations spaces to which the user belongs to whenever they click on the Spaces switcher li
-
How to go on creating activities in loop?
Hi! Lead record type has activities associated with it. if a new lead is created, automatically an initial activity should be created with certain details and assigned to a particular sales rep. this i can do with workflow. this is fine. Now i want t
-
Process of login with ADF security
Hi, I was looking at how to implement the process of Login with the ADF security using JDev 11g and I feel very good... My question is if it is possible to use this tool in case of use a container as Tomcat 6.x or JBoss. If it is possible to use ADF
-
Function module to find server details
Hi all, Is there any function module that will fetch me the system and server details. Thanks Mansi