APEX_MAIL.SEND() not seen executing MY procedure from TOAD

Hi,
I have a procedure that calls APEX_MAIL.SEND and works fine when executed from within the app or in the APEX Workshop window.
Trying to execute MY procedure from an Oracle job we get an error unknown procedure APEX_MAIL.SEND
anyone have this problem?

Hello,
Why don't you use utl_smtp package if you are wanting to send email from pl/sql?
If you look at the help for APEX_MAIL its says:
APEX_MAIL
You can use the APEX_MAIL package to send an email from an Oracle Application Express application. This package is built on top of the Oracle supplied UTL_SMTP package. Because of this dependence, the UTL_SMTP package must be installed and functioning in order to use APEX_MAIL.
So APEX_MAIL will only work within a valid apex session and it won't be available to a toad session .
Cheers,
Paul.

Similar Messages

  • Executing Stored Procedure from TOAD: ORA-00900: invalid SQL statement

    Ok…I have ALL the stored procedures converted into Oracle…now, when I go to test them I am getting the vague error of:
    ORA-00900: invalid SQL statement
    I am attempting to execute:
    --EXEC IEXGetAgentSysPerf(to_date('2008/09/01', 'yyyy/mm/dd/'), to_date('2008/09/11', 'yyyy/mm/dd'), 'US HelpDesk');
    EXEC IEXGetAgentSysPerf('9/1/2008', '9/11/2008', 'US HelpDesk');
    (Neither work). These are calling a Stored Procedure with the following header:
         PROCEDURE IEXGetAgentSysPerf (
              v_curparm_IEXGetAgentSysPerf     IN OUT      pkg_IEX.cur_IEXGetAgentSysPerf
              ,v_BDateTime     DATE
              ,v_EDateTime     DATE
              ,v_WorkGroup     VARCHAR2
    The IDE is “TOAD” for Oracle. Thanks in advance.

    Hi,
    This is your procedure
    PROCEDURE IEXGetAgentSysPerf (
    v_curparm_IEXGetAgentSysPerf IN OUT pkg_IEX.cur_IEXGetAgentSysPerf
    ,v_BDateTime DATE
    ,v_EDateTime DATE
    ,v_WorkGroup VARCHAR2
    you are providing the ,v_BDateTime DATE,v_EDateTime DATE and v_WorkGroup
    and how about "v_curparm_IEXGetAgentSysPerf ". So that procedures is returning the error.
    Adding the the earlier post, If you want to test the Stored Procedures... then I say you work on the PL/SQL
    Developer which good for debugging (easy to use...) When compare to TOAD.. :-)
    Test ..it there...
    - Pavan Kumar N

  • Executing Stored procedure from host file

    Hi all,
    I am trying to execute a procedure from a host file.I don't know where I am doing wrong but the procedure is not executing.
    #!/bin/bash
    echo "*********************** Initializing Global Variables ***********************"
    export CONNECT_STRING=$1
    export START_TIME=`date +%m/%d/%Y:%H%M`
    #export DATE_FROM=`date +%m/%d/%Y:%H%M`
    #export DATE_TO=`date +%m/%d/%Y:%H%M`
    DATE_FROM=$5
    DATE_TO=$6
    sqlplus -S -S -S -S -S -S -S -S -S -S -S -S -S -S -S -S -S -S -S -S -S -S -S -S -S -S -S -S -S -S ${CONNECT_STRING} <<EOF
        WHENEVER SQLERROR EXIT FAILURE
        set echo off
        execute xxjy_extract_ar_transactions.main_preinterface('$DATE_FROM','$DATE_TO');
    EOF
    echo "From Date is $DATE_FROM"
    echo "To Date is $DATE_TO" In my log i can see the From Date is 1-Jan-2013 and To date is 28-Feb-2013 which are my input parameters to concurrent program.But I don't understand why my procedure is not getting called.
    Please advice.
    Thanks,
    Sandeep

    Please post the details of the application release, database version and OS.
    Is the issue with this specific host concurrent program?
    Did you follow the steps in these docs?
    How to Register a Host Concurrent Program in Applications [ID 156636.1]
    How To Create A Custom Concurrent Program With Host Method and Pass Parameters To The Shell Script [ID 266268.1]
    How Do You Run A Unix Host Script From Concurrent Managers On MS Windows Platform? [ID 412392.1]
    How To Setup A Custom Concurrent Host Program [ID 147455.1]What is the reason of using more than one "-S" in the sqlplus command?
    Please enable trace and generate the TKPROF file to find out what is happening when you kick off this concurrent program?
    FAQ: Common Tracing Techniques within the Oracle Applications 11i/R12 [ID 296559.1]
    How To Trace a Concurrent Request And Generate TKPROF File [ID 453527.1]
    Thanks,
    Hussein

  • Execute oracle procedure from SSIS

    is it possible to execute Oracle procedure from within SSIS?
    thanks

    Hi,
    I used
    begin
    test1;
    end;
    and it is giving - SSIS package "Package.dtsx" finished: Success, but it is not doing anything.
    "test1" procedure has couple of insert statements and a commit statements but the package is not inserting anything.
    Also when I use "exec test1;" it is failing with the error mentinoed here in the forum.
    Any idea what is wrong here?

  • Execute Stored Procedures from Stellent

    Can we execute stored procedures from stellent 7.5.2 ?
    By using java, I dont find any method to execute stored procedure from WorkSpace interface.
    Please guide me to solve this..
    Appreciate your help and efforts.

    May not be exactly what you're looking for, but I hope this helps:
    http://www.corecontentonly.com/Blog/Calling-A-Stored-Procedure-From-Oracle-Fusion-ECM-Stellent
    For java based execution basically:
    1. Create your stored proc in the db
    2. Create a component
    3. Create a query resource
    4. In your java code use the createResultSet method of the Workspace object and pass in the name of your query resource and then the current databinder object

  • How to execute another schema procedure from toad?

    Hi,
    i want to execute procedure from another schema from toad. already i have created synonym for that procedure and provided execute permission.
    how to execute procedure from toad?
    Thanks,

    Hi,
    The vendor of that product is running their own forums
    http://toadfororacle.com/index.jspa
    Not sure how they feel about
    Handle:      user2017273
    Status Level:      Newbie
    Registered:      Oct 4, 2009
    Total Posts:      64
    Total Questions:      44 *(36 unresolved)*

  • How to execute a procedure from BODI?

    Hi Pals ,
    I have procedure in my database say EMP_PROC. I want to execute this procedure from the BODI environment.Please do let me know.
    Thanks in advance.
    Regards,
    Diras

    you have to import the stored procedure in the datastore
    and after importing you can call the stored procedure in the mapping
    use import by name option in datastore, and select function in type and enter the name of stored proc that you want to use in DI
    check technical manual for more details on importing functions and stored procedure

  • Not able to execute a procedure from Process

    Hi
    I have created a Tabular Form type region.
    And I have created a Database procedure to insert records into some other table.
    Inorder to execute this procedure I was trying to create a PL/SQL Page process.
    When I am trying to enter the procedure details it is giving below error.
    1 error has occurred
    ORA-06550: line 3, column 1: PLS-00201: identifier 'XXSURCHARGE_PKG.INSERT_INTO_MAIN' must be declared ORA-06550: line 3, column 1: PL/SQL: Statement ignored
    But I am able to create a page process with same procedure in another application.
    Is there any restrictions on Tabular Form type regions.
    Regards
    Kiran Akkiraju

    Hi
    I am able to find out the problem. Application was created on a particular Schema and procedure was created another schema. So, there was a permission issue.
    Regards
    Kiran Akkiraju

  • Execute store procedure from form

    How do I execute a store procedure from FORM
    I have a store procedure in the database
    all it does insert a value to table test.
    in 'WHEN-NEW-INSTANT-TRIGGER' of the form MODLUE I put
    test_curor; (name of the store procedure)
    The module does have block or any thing it.
    There was no syntax errors or form error
    but it did not insert into the table.
    Why????

    I just tested this myself and you are right. If you have one block with no items in it the when-new-form-instance trigger will not be fired. I got a message back saying 'block had no items', though it ran OK. This kinda makes logical sense, since there is nothing for the form to do. I put a button onto the block and the procedure fired no problem. I must admit I have never tried creating a form with no items in it so I haven't seen this behaviour before.
    Shucks you live and learn every day!

  • Problem in executing Stored Procedure from Trigger

    Hi,
    Case1.
    I am executing a stored procedure form a trigger. The stored procedure is not executing fully.
    Case 2.
    But when when I execute Stored Procedure alone it is executing.
    CREATE OR REPLACE TRIGGER mhubadmin.call_proc_ratesheet_new
    after INSERT OR delete ON mhubadmin.pvt_br_ratesheet
    FOR EACH ROW
    declare
    var_orgid number;
    begin
    if inserting then
    select org_child_id into var_orgid from business_relationship where br_id=:new.br_id;
    mhubadmin.proc_ratesheet_new(var_orgid);
    else
    select org_child_id into var_orgid from business_relationship where br_id=:old.br_id;
    mhubadmin.proc_ratesheet_new(var_orgid);
    end if;
    end;
    CREATE OR REPLACE PROCEDURE proc_ratesheet_new(var_orgid in number)
    IS
    cursor c3 is select distinct(purs.user_id) from hubuser hu
    inner join PVT_USER_RATESHEET purs on hu.USER_ID=purs.USER_ID
                   where hu.ORG_ID=var_orgid;
    cursor c1(varUser_id number) is select purs.user_id,purs.ratesheet_id from hubuser hu
    inner join PVT_USER_RATESHEET purs on hu.USER_ID=purs.USER_ID
                   where hu.ORG_ID=var_orgid and purs.USER_ID=varUser_id;
    cursor c2(varUser_id number) is select hu.user_id,pbr.ratesheet_id from HUBUSER hu
                             inner join BUSINESS_RELATIONSHIP br on hu.ORG_ID=br.ORG_CHILD_ID
                             inner join PVT_BR_RATESHEET pbr on br.BR_ID=pbr.BR_ID
                                  where hu.user_id in(select distinct(purs.USER_ID) from hubuser hu
                                       inner join PVT_USER_RATESHEET purs
                                                                     on hu.USER_ID=purs.USER_ID
                                                 where hu.ORG_ID=var_orgid) and hu.user_id=varUser_id;
    foundFlag boolean;
    incrFound integer;
    insertFound integer;
    deleteFound integer;
    str varchar2(4000);
    BEGIN
         incrFound:=0;
         insertFound:=0;
         for c3var in c3 loop
    for c2var in c2(c3var.user_id) loop
              insert into test values ('Step3:'||c2var.user_id);
              foundFlag:=false;
              for c1var in c1(c3var.user_id) loop
                   if c2var.ratesheet_id=c1var.ratesheet_id then
                        foundFlag:=true;
                             incrFound:=incrFound+1;
                             exit;
                        end if;
                   end loop;
                   if foundFlag=False then
                   --insert into pvt_user_ratesheet (username_ratesheet_id,user_id,ratesheet_id) values (SEQ_USER_RATESHEET.nextval,c3var.user_id,c2var.ratesheet_id);
                   dbms_output.put_line('Inserted for user :'||c3var.user_id||' is - ratesheet :'||c2var.ratesheet_id);
                   insertFound:=insertFound+1;
                   end if;
              end loop;
    end loop;
         commit;
         incrFound:=0;
         deleteFound:=0;
         for c3var in c3 loop
              for c1var in c1(c3var.user_id) loop
              foundFlag:=false;
              for c2var in c2(c3var.user_id) loop
                        if c1var.ratesheet_id=c2var.ratesheet_id then
                        foundFlag:=true;
                        incrFound:=incrFound+1;
                        exit;
                        end if;
                   end loop;
                   if foundFlag=False then
                   --delete from pvt_user_ratesheet where user_id=c3var.user_id and ratesheet_id=c1var.ratesheet_id;
                        --dbms_output.put_line('Deleted for userid:'||c3var.user_id||' for ratesheet :'||c1var.ratesheet_id);
                        deleteFound:=deleteFound+1;
                   end if;
              end loop;
    end loop;
         commit;
    EXCEPTION
    WHEN OTHERS THEN
    DBMS_OUTPUT.put_line (SQLCODE||' '|| SQLERRM);
    END;
    Regards,
    Mathew

    In general, I would suggest that you only catch errors that you can handle reasonably. If you know that a SELECT INTO might return 0 rows for example, handle the NO_DATA_FOUND exception. Having a WHEN OTHERS, particularly without re-raising the exception, only serves to hide the source of the problem. I would much rather that my code fail quickly and explicitly than hope that I see an error message in the output and that other code doesn't start failing because the system wasn't left in an appropriate state.
    As Mark suggests, you may choose to implement a comprehensive logging framework using autonomous transactions, in which case a WHEN OTHERS would be reasonable, but you would still want to propagate exceptions you cannot handle.
    If you see a WHEN OTHERS clause and there is no RAISE, you probably have an error waiting to happen.
    Justin

  • Execute stored procedure from TestStand

    I am having difficulty executing a stored procedure from the TestStand Database step types.  I am using the "Data Operation" step type to set the input parameter, but I still get the following error;
    Procedure or function 'sproc_prior step' expects parameter '@serial_number', which was not supplied.
    I've attached the sequence file for review.
    Any help would be appreciated.
    Attachments:
    db Stored Procedure1.seq ‏9 KB

    We were able to fix this sequence by making the following changes:
    1.) In the Open SQL Statement change the Command Type to Stored Procedure instead of Default.
    2.) On the Get Results step change the Operation to Get - Retrieve Values from Record instead of Close since the Close SQL Statement takes care of that for you.
    3.) Also change the Record To Operate On to Current - Use Current Record.
    After making these changes the sequence should work.  Also note, that it would be preferable to change the stored procedure name to us all underscores and not spaces since this is more standard for use with databases.
    John B.
    Applications Engineer
    National Instruments

  • PL/SQL: Executing a procedure from within another procedure

    Hello, I'm a newbie and I need help on how to execute procedures from within another procedure. The procedure that I call from within the procedure have return values that I want to check.
    I tried: EXECUTE(user_get_forum_info(p_forumid, var_forum_exists, var_forum_access, var_forumname));
    but I get the error message:
    PLS-00103: Encountered the symbol "USER_GET_FORUM_INFO" when expecting one of the following::= . ( @ % ; immediate
    The symbol ":=" was substituted for "USER_GET_FORUM_INFO" to continue.
    And when I tried: EXECUTE(user_get_forum_info(p_forumid, var_forum_exists, var_forum_access, var_forumname));
    I get the error message:
    PLS-00222: no function with name 'USER_GET_FORUM_INFO' exists in this scope
    PL/SQL: Statement ignored
    The procedure USER_GET_FORUM_INFO exists. (don't understand why it says "no FUNCTION with name", it's a procedure I'm executing)
    I'm stuck so thanks for any help...
    Below is all the code. I'm using Oracle 9i on RedHat Linux 7.3.
    ================================================================================
    CREATE OR REPLACE PROCEDURE user_forum_requestsaccess (
    p_forumid IN NUMBER,
    p_requestmessage IN VARCHAR2
    AS
    var_forumid NUMBER;
    var_forum_exists NUMBER;
    var_forum_access NUMBER;
    request_exists NUMBER;
    var_forumname VARCHAR2(30);
    FORUM_DOESNT_EXIST EXCEPTION;
    FORUM_USER_HAS_ACCESS EXCEPTION;
    FORUM_REQUEST_EXIST EXCEPTION;
    BEGIN
    SELECT SIGN(NVL((SELECT request_id FROM forum.vw_all_forum_requests WHERE forum_id = p_forumid AND db_user = user),0)) INTO request_exists FROM DUAL;
    EXECUTE(user_get_forum_info(p_forumid, var_forum_exists, var_forum_access, var_forumname));
    IF var_forum_exists = 0 THEN
    RAISE FORUM_DOESNT_EXIST;
    ELSIF var_forum_access = 1 THEN
    RAISE FORUM_USER_HAS_ACCESS;
    ELSIF request_exists = 1 THEN
    RAISE FORUM_REQUEST_EXIST;
    ELSE
    INSERT INTO tbl_forum_requests VALUES (SEQ_TBL_FORUM_REQ_REQ_ID.NEXTVAL, SYSDATE, p_requestmessage, p_forumid, user);
    INSERT INTO tbl_forum_eventlog VALUES (SEQ_TBL_FORUM_EVNTLOG_EVNT_ID.NEXTVAL,SYSDATE,1,'User ' || user || ' requested access to forum ' || var_forumname || '.', p_forumid,user);
    COMMIT;
    END IF;
    EXCEPTION
    WHEN
    FORUM_DOESNT_EXIST
    THEN RAISE_APPLICATION_ERROR(-20003,'Forum doesnt exist.');
    WHEN
    FORUM_USER_HAS_ACCESS
    THEN RAISE_APPLICATION_ERROR(-20004,'User already have access to this forum.');
    WHEN
    FORUM_REQUEST_EXIST
    THEN RAISE_APPLICATION_ERROR(-20005,'A request to this forum already exist.');
    END;
    GRANT EXECUTE ON user_forum_requestsaccess TO forum_user;
    ================================================================================
    Regards Goran

    you don't have to use execute when you want to execute a procedure (only on sql*plus, you would use it)
    just give the name of the funtion
    create or replace procedure test
    as
    begin
        dbms_output.put_line('this is the procedure test');
    end test;
    create or replace procedure call_test
    as
    begin
        dbms_output.put_line('this is the procedure call_test going to execute the procedure test');
        test;
    end call_test;
    begin
        dbms_output.put_line('this is an anonymous block calling the procedure call_test');
        call_test;
    end;
    /

  • Facing error while trying to execute stored procedure from JSF Application

    Hi, I am facing the below error when I try to execute a stored Procedure from JSF application which is deployed on WAS 7.0
    =2013-03-04 19:06:58,550 INFO [com.lloydstsb.iw.util.DBUtils] - DBUtils : executeFileNetStoredProc method started..
    =2013-03-04 19:11:58,271 ERROR [com.lloydstsb.iw.dao.FileNetCustomDBSynchDAOImpl] - Data Access Exception
    com.lloydstsb.iw.common.exceptions.DataAccessException: Data Access Exception Occured : Integration Stored Proc- java.sql.SQLException: java.lang.ClassCastException: oracle.jdbc.driver.LogicalConnection incompatible with oracle.jdbc.OracleConnection
         at com.lloydstsb.iw.util.DBUtils.executeFileNetStoredProc(DBUtils.java:959)
         at com.lloydstsb.iw.util.DAOUtil.executeFileNetStoredProc(DAOUtil.java:117)
         at com.lloydstsb.iw.dao.FileNetCustomDBSynchDAOImpl.updateFileNetDetailsCustomDB(FileNetCustomDBSynchDAOImpl.java:36)
         at com.lloydstsb.iw.servlet.IndexServlet.service(IndexServlet.java:127)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
         at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1443)
         at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:790)
         at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:443)
         at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:175)
         at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:91)
         at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:859)
         at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1557)
         at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:173)
         at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:455)
         at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:384)
         at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:83)
         at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
         at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
         at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
         at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
         at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:202)
         at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:766)
         at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:896)
         at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1527)
    The oracle version we are using is 11g.
    Previously it worked fine when the application was used in 10g.
    Can someone please help me in resolving this issue?
    Kiran
    Edited by: 991640 on Mar 4, 2013 8:25 PM

    java.lang.ClassCastException: oracle.jdbc.driver.LogicalConnection incompatible with oracle.jdbc.OracleConnection
    Are the the JDBC JARs packaged with the application? If so, remove the applicaiton packaged JDBC JARs as the JARs are also in WebSphere application server.

  • Not all executables will start from spawned batch (Is this a WinNT bug?).

    I'm building a tool wherewith I can spawn a make process from my Visual Age for Java IDE.
    This I have working now. However not all executables seem to get started from the batch.
    Here are some of the from within the batch file started examples that work and won't work:
    echo MakeBridge V1.00
    echo Ensure that
    echo %1%2
    echo is a (sub) directory of
    echo %JAVA_DEV_ROOT%
    REM Usage: makeBridge <drive_letter> <working_directory> <make_command>
    REM Change drive
    %1 WORKS
    REM Change directory
    chdir %2 WORKS
    REM Execute make command
    echo ####%3#### WORKS
    clearmake -C gnu %3 %4 %5 %6 %7 %8 %9 WON'T WORK
    echo path=%PATH% WORKS
    pwd WORKS
    dir WORKS
    java -version WON'T WORK
    rem C:\APPL\_off97uk.32\Office\EXCEL.EXE WORKS
    echo Marcel Zeeuw WORKS
    The actual coding for the spawning is below:
    Process p = Runtime.getRuntime().exec(batch);
    // Pick up output stream from spawned process
    BufferedReader br = new BufferedReader(
    new InputStreamReader(p.getInputStream()));
    String line;
    while ((line = br.readLine()) != null)
    System.out.println(line);
    br.close();
    System.out.println(p.exitValue());
    Help would be appreciated
    Kind regards,
    Marcel Zeeuw.

    Explicit naming of a path in front of a non-starting application doesn't help - as expected.
    My conclusion is, that a process that is spawned by an application inherit some sort of limiting environment space. THis is because when I start my not working batch file from a command prompt, the batch file works as expected.
    I have no solution for this problem for now...

  • Execute stored procedure from DOS or Unix Shell

    Hi, need ur help again,
    How to execute the stored procedure from DOS or Unix Shell?
    Thanks!

    sqlplus -s /NOLOG @your_sql_script.sql
    -- your_sql_script.sql :
    connect user/password@connect_string
    execute package.procedure (param1, param2, ...) -- for packages
    execute procedure (param1,...) -- for procedures
    exit ;this way you won't advertise your user/password on unix systems

Maybe you are looking for

  • How can I create a checklist in Pages (not Numbers) ?

    Hello all, Just curious if ANYONE out there has figured out how to implement a checkable checklist in Pages.  I am familiar with the Checklist template in Numbers, but it is not very pretty, for lack of a better word.  I need to create a stylish chec

  • Issue with PDF links and opened Adobe files

    I have tested and IE 8 opens correct links inside PDF's. When I open link in Mozilla or Chrome it will not work. Is this related to Adobe Plugin which is installed inside Add-ons? Strange is that link inside PDF shows the following link:resource://pd

  • Default Global Address List

    Hello all. Running Exchange 2010 Standard SP3 and I am having a strange issue right now. My Outlook clients (2010 and 2013) can only see the GAL when in cached mode. For some users they are setup with cached mode turned off and in these cases they ca

  • Portal users activity reports

    Hi all, Is there any way to see a list of currently logged on users and the current page that they see? Aviad

  • Sending Workitem as attacment through send mail

    Hi all I got an issue while doing Parking Documents relase in FI. My issue is when ever a document is parked from F-65 a work item containing the relese procedure should be send through an email to the sap inbox. All is working fine except i dont no