Apex4 apex_util.find_security_group_id returns 0

Just upgraded from Apex 3.2 to 4.0. All app's appears to have migrated fine.
When I do following it retunrs 0 instead of the workspace id. SDC is name of my workspace.
select apex_util.find_security_group_id('SDC') from dual;
returns 0.
But if I do followiing I get correct id back.
select apex_030200.apex_util.find_security_group_id('SDC') from dual;
Edited by: sdcsdc on Aug 12, 2010 3:42 PM
Edited by: sdcsdc on Aug 12, 2010 3:44 PM

Actually a colleague of mine did some more investigation and found out that it's actually a bug in 4.0. It will be fixed in our 4.0.1 patchset.
Thanks for finding this bug!
Patrick
My Blog: http://www.inside-oracle-apex.com
APEX 4.0 Plug-Ins: http://apex.oracle.com/plugins
Edited by: Patrick Wolf3 on Aug 13, 2010 3:58 PM

Similar Messages

  • BUG Apex4.0 AnyChart: apex_util.flash  - returning zero rather than null

    [Line chart screen capture|http://www.anaruk.com/linechart.jpg]
    The chart image I linked to above is a year over year sales chart. The first series returns 2009 Sales. The second returns year to date 2010. The problem is that even though the query returns no data for August through December of 2010 - because they haven't happened yet - the XML returned by the apex_util.flash proc returns those months with a zero value causing the chart to plot that data.
    2009 query result set:
    LINK MONTH SALES
    - Jan 250
    - Feb 230
    - Mar 360
    - Apr 130
    - May 120
    - Jun 180
    - Jul 130
    - Aug 280
    - Sep 270
    - Oct 250
    - Nov 360
    - Dec 410
    2010 query result set:
    LINK MONTH SALES
    - Jan 130
    - Feb 970
    - Mar 170
    - Apr 140
    - May 110
    - Jun 230
    - Jul 440
    XML for 2010 comes back:
    <series name="YTD 2010" type="Line" color="0x1D8BD1">
    <point name="Jan" y="130">
    </point>
    <point name="Feb" y="970">
    </point>
    <point name="Mar" y="170">
    </point>
    <point name="Apr" y="140">
    </point>
    <point name="May" y="110">
    </point>
    <point name="Jun" y="230">
    </point>
    <point name="Jul" y="440">
    </point>
    <point name="Aug" y="0">
    </point>
    <point name="Sep" y="0">
    </point>
    <point name="Oct" y="0">
    </point>
    <point name="Nov" y="0">
    </point>
    <point name="Dec" y="0">
    </point>
    </series>
    IF I modify and load the following, AnyChart correctly does not plot the last four months:
    <series name="YTD 2010" type="Line" color="0x1D8BD1">
    <point name="Jan" y="130">
    </point>
    <point name="Feb" y="970">
    </point>
    <point name="Mar" y="170">
    </point>
    <point name="Apr" y="140">
    </point>
    <point name="May" y="110">
    </point>
    <point name="Jun" y="230">
    </point>
    <point name="Jul" y="440">
    </point>
    <point name="Aug" y="">
    </point>
    <point name="Sep" y="">
    </point>
    <point name="Oct" y="">
    </point>
    <point name="Nov" y="">
    </point>
    <point name="Dec" y="">
    </point>
    </series>
    Thanks for any feedback.
    Walter
    Edited by: WannaRock on Jul 23, 2010 2:17 PM
    - made Subject more descriptive
    - fixed three typos

    Hi Walter,
    Thanks for bringing this to our attention. The behaviour you have reported is the current default behaviour for handling null values on the Line chart, where they are represented as zero in the series data. I appreciate this handling is not what you would expect, particularly in your scenario, where you do not wish to represent certain points on the chart (AUG - DEC 2010), so I will revise this behaviour and include a fix for this in our upcoming patch release 4.0.1. I've logged bug 9945462 to track this issue.
    Regards,
    Hilary

  • Apex_util.get_print_document returns empty blob

    Hi,
    I'm trying to convert a xsl-fo template into PDF. I have the following code:
    begin
    declare
    v_retval blob;
    v_data blob;
    v_xls clob;
    v_xml_dat clob;
    begin
    select page_template
    into v_xls
    from flows_030100.wwv_flow_report_layouts
    where flow_id =101
    and report_layout_name = 'vv';
    v_xml_dat := to_clob('<data><row><dat1>fff</dat1></row></data>');
    v_data := wwv_flow_utilities.clob_to_blob(v_xml_dat);
    v_retval := apex_util.get_print_document (v_data,v_xls,'xsl-fo','pdf')
    htp.p(dbms_lob.getlength(v_retval));
    end;
    end;
    This returns 0 instead of some PDF document. I guess there is something wrong with my input, probably the XML data. Any thoughts?

    Anyone?

  • Making apex_util.get_print_document return an error message

    We are using apex_util.get_print_document in a process to run a report something like this:
    declare
       l_report blob := null;
    begin
        l_report := apex_util.get_print_document (
            p_application_id      => :APP_ID,
            p_report_query_name   => 'report_query_name',
            p_report_layout_name  => 'report_layout_name',
            p_report_layout_type  => 'rtf',
            p_document_format     => 'rtf'
       if l_report is not null and dbms_lob.getlength(l_report) > 0 then
          apex_application.g_print_success_message := 'Report Created.<br>';       
          INSERT INTO reports (attachment, date_created, filename, mime_type)
          VALUES (l_report, sysdate, 'report.rtf', 'text/rtf' );       
       else       
          apex_application.g_print_success_message := '<span style="color:#CC0000">There was a problem creating the report.</span><br>';   
       end if; 
    end;And this works well most of the time. The problem is, if the report fails for some reason, apex_util.get_print_document gives no information whatsoever as to what went wrong. Is there any way at all we can find out what the problem was?
    Application Express 4.0.2.00.07
    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

    Hi,
    add exception to your code.
    declare
       l_report blob := null;
    begin
        l_report := apex_util.get_print_document (
            p_application_id      => :APP_ID,
            p_report_query_name   => 'report_query_name',
            p_report_layout_name  => 'report_layout_name',
            p_report_layout_type  => 'rtf',
            p_document_format     => 'rtf'
       if l_report is not null and dbms_lob.getlength(l_report) > 0 then
          apex_application.g_print_success_message := 'Report Created.<br>';       
          INSERT INTO reports (attachment, date_created, filename, mime_type)
          VALUES (l_report, sysdate, 'report.rtf', 'text/rtf' );       
       else       
          apex_application.g_print_success_message := '<span style="color:#CC0000">There was a problem creating the report.</span><br>';   
       end if; 
    EXCEPTION
       WHEN OTHERS THEN
          raise_application_error(-20001,'An error was encountered - '||SQLCODE||' -ERROR- '||SQLERRM);
    end;This will give proper error message.
    Hope this will helps you.
    Regards,
    Jitendra

  • APEX_UTIL.GET_PRINT_DOCUMENT always returning empty BLOB

    Dear community,
    I have a huge problem when using the function APEX_UTIL.GET_PRINT_DOCUMENT in a job or database procedure.
    The following code runs perfectly when I integrate it in the APEX application directly e.g. using a button to execute it (of course I use an anonymous PL/SQL block in APEX itself). But when I run the same code as a procedure or job in the APEX database itself I always receive a mail with an empty PDF:
    CREATE OR REPLACE PROCEDURE APEX_DRUG_SAFETY.CALL_MAIL
    is
    l_id number;
    l_document BLOB;
    BEGIN
    wwv_flow_api.set_security_group_id;
    l_document := APEX_UTIL.GET_PRINT_DOCUMENT
    +(+
    p_application_id=>'105',
    p_report_query_name=>'TestReport',
    p_report_layout_type=>'pdf',
    p_document_format=>'pdf'
    +);+
    l_id := APEX_MAIL.SEND
    +(+
    p_to        => '[email protected]',
    p_from      => '[email protected]',
    p_subj      => 'sending PDF via print API',
    p_body      => 'Please review the attachment.',
    p_body_html => 'Please review the attachment.'
    +);+
    APEX_MAIL.ADD_ATTACHMENT
    +(+
    p_mail_id    => l_id,
    p_attachment => l_document,
    p_filename   => 'mydocument.pdf',
    p_mime_type  => 'application/pdf'
    +);+
    wwv_flow_mail.push_queue(
    P_SMTP_HOSTNAME => 'DESMTP.TEST.COM',
    P_SMTP_PORTNO => '25');
    end;
    The problem is that the function APEX_UTIL.GET_PRINT_DOCUMENT always returns an empty BLOB when executed outside of the APEX application. I found this issue in several other posts in this forum but I did not find a solution.
    The mail transmission itself works perfectly. Also with an attachment if e.g. I use another BLOB already stored in the database for testing purposes. So it is not the mail transmission that causes the problem but the empty variable l_document that is still empty.
    Thanks in advance for the help.

    user9007075 wrote:
    Dear community,
    wwv_flow_api.set_security_group_id;
    you should be using this
        l_workspace_id := apex_util.find_security_group_id (p_workspace => 'YOUR_WORKSPACE_NAME');
        apex_util.set_security_group_id (p_security_group_id => l_workspace_id);
    http://docs.oracle.com/cd/E23903_01/doc/doc.41/e21676/apex_util.htm#AEAPI512

  • Application Express 4.0.2.00.07 apex_util.set_security_group_id exception

    Hi,
    I am trying to trigger apex_util.edit_user procedure.
    But first I need set security group id. I queried SELECT provisioning_company_id FROM APEX_040000.wwv_flow_companies where short_name='MIS' and tried apex_util.set_security_group_id (3587726189450463).
    But error is occued:
    Error report:
    ORA-20001: Security Group ID (your workspace identity) is invalid.
    ORA-06512: at "APEX_040000.HTMLDB_UTIL", line 3175
    ORA-06512: at line 2
    And also select * from apex_workspaces returned empty list... apex_util.find_security_group_id (p_workspace => 'MIS') return 0

    user13830503 wrote:
    Hi,
    I am trying to trigger apex_util.edit_user procedure.
    But first I need set security group id. I queried SELECT provisioning_company_id FROM APEX_040000.wwv_flow_companies where short_name='MIS' and tried apex_util.set_security_group_id (3587726189450463).
    But error is occued:You should use:
    l_workspace_id := apex_util.find_security_group_id (p_workspace => 'MIS');
        apex_util.set_security_group_id (p_security_group_id => l_workspace_id);See http://docs.oracle.com/cd/E17556_01/doc/apirefs.40/e15519/apex_util.htm#AEAPI512
    Error report:
    ORA-20001: Security Group ID (your workspace identity) is invalid.
    ORA-06512: at "APEX_040000.HTMLDB_UTIL", line 3175
    ORA-06512: at line 2
    And also select * from apex_workspaces returned empty list... apex_util.find_security_group_id (p_workspace => 'MIS') return 0Debug the apex_workspaces view to find out why its not showing up your workspace
    I guess it will be something to do with the schema you are trying to access from!

  • Create a session programatically (ie, outside of APEX).

    Following on from this thread (Using APEX Collections outside of APEX? we have a requirement to be able to create a user session programatically in sqlplus etc, so that we can utilize the APEX collections framework in our existing developments.
    The issue I am having is with getting the session populated in the wwv_flow_sessions$ table.
    If I create a session first by opening a page in APEX then my processing works fine using that session id, the problem comes when I want to programatically create a new session.
    I have tried the following (where l_session is the id of the session I grabbed from running an APEX page):
    DECLARE
      l_security_group_id  NUMBER := apex_util.find_security_group_id('OUR_WORKSPACE');
      l_session_id         NUMBER := apex_custom_auth.get_next_session_id;
      l_val                VARCHAR2(4000);
      v_arr                wwv_flow_global.vc_arr2;
    BEGIN
      wwv_flow_api.set_security_group_id(l_security_group_id);
      apex_application.g_flow_id  := '1';
      apex_custom_auth.define_user_session('USERNAME', l_session_id);
      apex_custom_auth.post_login(p_uname => 'USERNAME', p_session_id => l_session_id);  /*Added this as an after-thought but it made no difference*/
      apex_collection.create_collection('XXTEST');
      /*some more things after this but it never gets that far*/but I get the error:
    ORA-02291: integrity constraint (FLOWS_030100.WWV_FLOW_COLLECTION_FK) violated - parent key not found
    ORA-06512: at "FLOWS_030100.WWV_FLOW_COLLECTION", line 288
    ORA-06512: at line 12Running v('SESSION') returns a value, so the session is being populated, it's just a corresponding record isn't inserted into wwv_flow_sessions$.
    Is there any API to create such a session? If not, what are the implications of doing a manual insert into this table before processing and then removing the row afterwards?

    Ok, i see.
    Why do you need the record in the session-table, does CREATE_COLLECTION require that?
    I never created a Collection in a batch-job outside of APEX, but created/called an APEX Report. To "create" the session i used this code:
    PROCEDURE initApexFromOutside
      ( i_app_name     IN VARCHAR2
      , i_page_id      IN NUMBER
      , i_apex_user    IN VARCHAR2
    IS
        v_cgivar_name  owa.vc_arr;
        v_cgivar_val   owa.vc_arr;
        v_workspace_id NUMBER;
        v_app_id       NUMBER;
    BEGIN
        -- set up cgi environment
        htp.init;
        v_cgivar_name(1) := 'REQUEST_PROTOCOL';
        v_cgivar_val(1)  := 'HTTP';
        owa.init_cgi_env
          ( num_params => v_cgivar_name.count
          , param_name => v_cgivar_name
          , param_val  => v_cgivar_val
        -- load apex IDs by application name
        SELECT workspace_id,
               application_id
        INTO v_workspace_id,
             v_app_id
        FROM apex_applications
        WHERE application_name=i_app_name;
        -- set up apex workspace
        wwv_flow_api.set_security_group_id(v_workspace_id);
        -- set up apex session vars
        apex_application.g_instance     := wwv_flow_custom_auth.get_next_session_id;
        apex_application.g_flow_id      := v_app_id;
        apex_application.g_flow_step_id := i_page_id;
        -- "login"
        apex_custom_auth.define_user_session
          ( p_user       => i_apex_user
          , p_session_id => apex_application.g_instance
        wwv_flow_custom_auth_std.post_login
          ( p_uname      => i_apex_user
          , p_session_id => apex_application.g_instance
          , p_flow_page  => apex_application.g_flow_id
                         || ':'
                         || apex_application.g_flow_step_id
    END initApexFromOutside;
    PROCEDURE doInitApex(pUsername IN VARCHAR2)
    IS
    BEGIN
        IF v('APP_ID') IS NULL
        THEN
            -- init apex environment
            initApexFromOutside
              ( i_app_name  => cAppName
              , i_page_id   => 1
              , i_apex_user => pUsername
            -- call show once because it sets additonal internal apex parameters
            Apex_Application.show
              ( p_flow_id        => Apex_Application.g_flow_id
              , p_flow_step_id   => Apex_Application.g_flow_step_id
              , p_instance       => Apex_Application.g_instance
            -- show re-sets other parameters at the end. have to init again...
            initApexFromOutside
              ( i_app_name  => cAppName
              , i_page_id   => 1
              , i_apex_user => pUsername
        END IF;
    END;Maybe this works for you, too.
    brgds,
    Peter
    Blog: http://www.oracle-and-apex.com
    ApexLib: http://apexlib.oracleapex.info
    BuilderPlugin: http://builderplugin.oracleapex.info
    Work: http://www.click-click.at

  • Generating PDF Report and Mailing from APEX through DBMS_SCHEDULER job

    Hi,
    We have a requirement to generate pdf reports and mail them from our apex app through a DBMS_SCHEDULER job. The DBMS_SCHEDULER job calls a PL/SQL procedure which has the logic for calling the APEX_UTIL.GET_PRINT_DOCUMENT API (Function Signature 3) passing the application_id, the report_query_name and the report_layout_name  to generate the pdf report output. The APEX_UTIL.GET_PRINT_DOCUMENT call is returning NULL when called from the DBMS_SCHEDULER job (It doesn't throw any exception as well!). But the same procedure when called from an APEX App Page Process that is invoked on an event like a Button click, the API returns the PDF report output.
    I am also setting the APEX workspace security_group_id at the beginning of the PL/SQL procedure as follows:
    l_workspace_id := apex_util.find_security_group_id (p_workspace => 'MY_WORKSPACE');
    apex_util.set_security_group_id (p_security_group_id => l_workspace_id);
    Any idea on what might be going wrong? Any alternative ways to generate the report output in the PL/SQL procedure?
    Thanks & Regards,
    Sujesh K K

    I was able to do a workaround for this issue by rebooting the DB.
    As per ID 579281.1, this is a bug in 11.1.0.6 and we need to upgrade the version to 11.1.0.7 or apply a one -off patch.
    Thanks,
    Arun

  • PDF Attachment problem in Adobe form and send mail is not working

    Dear Experts,
                         Recently i'm facing a problem regarding Adobe form PDF attachment and sending an e-mail along with the PDF attachment to customer mail id.But when i execute the RFC Function module, in customer side no mail is comming. And when i check the transaction SBWP then i found that the PDF attachment hold only 1KB of data which is not right.For that i'm sending my code which i was declared in my program.Can anybody please help me to overcome this problem?
    Warm Regards,
    sameek.
    CLASS cl_bcs DEFINITION LOAD.
      DATA:
      lo_send_request TYPE REF TO cl_bcs VALUE IS INITIAL.
      lo_send_request = cl_bcs=>create_persistent( ).
      data: t_att_content_hex type SOLIX_TAB.
      DATA: lx_document_bcs TYPE REF TO cx_document_bcs VALUE IS INITIAL.
      DATA: lo_sender TYPE REF TO if_sender_bcs VALUE IS INITIAL,
            l_send type ADR6-SMTP_ADDR value 'Already provided an e-mail address here'.
      DATA: lo_recipient TYPE REF TO if_recipient_bcs VALUE IS INITIAL.
      DATA: lv_sent_to_all(1) TYPE c VALUE IS INITIAL.
    Message body and subject*
      DATA:
      lt_message_body TYPE bcsy_text VALUE IS INITIAL,
      lo_document TYPE REF TO cl_document_bcs VALUE IS INITIAL.
      APPEND 'Dear,' TO lt_message_body.
      append ' ' to lt_message_body.
      APPEND 'Please fill the attached form and send it back to us.'
      TO lt_message_body.
      append ' ' to lt_message_body.
      APPEND 'Thank You,' TO lt_message_body.
      lo_document = cl_document_bcs=>create_document(
      i_type = 'RAW'
      i_text = lt_message_body
      i_subject = 'Customer Information Form').
      TRY.
          lo_document->add_attachment(
          EXPORTING
          i_attachment_type = 'PDF'
          i_attachment_subject = 'Customer Information Form'
    I_ATTACHMENT_SIZE =*
    I_ATTACHMENT_LANGUAGE = SPACE*
    I_ATT_CONTENT_TEXT =*
    I_ATTACHMENT_HEADER =*
          i_att_content_hex = t_att_content_hex ).
        CATCH cx_document_bcs INTO lx_document_bcs.
      ENDTRY.
    Add attachment*
    Pass the document to send request*
      lo_send_request->set_document( lo_document ).
    Create sender*
      lo_sender = cl_cam_address_bcs=>create_internet_address( l_send ).
    lo_sender = cl_sapuser_bcs=>create( sy-uname ).*
    Set sender*
      lo_send_request->set_sender(
      EXPORTING
      i_sender = lo_sender ).
    Create recipient*
      lo_recipient = cl_sapuser_bcs=>create( sy-uname ).
    lo_recipient = cl_cam_address_bcs=>create_internet_address( l_send ).*
    Set recipient*
      lo_send_request->add_recipient(
      EXPORTING
      i_recipient = lo_recipient
      i_express = 'X' ).
    lo_send_request->add_recipient(*
    EXPORTING*
    i_recipient = lo_recipient*
    i_express = 'X' ).*
    Send email*
      lo_send_request->send(
      EXPORTING
      i_with_error_screen = 'X'
      RECEIVING
      result = lv_sent_to_all ).
      COMMIT WORK.
      message 'The Customer Information form has been emailed to the Employee' type 'I'.

    I am also facing issue with email send .
    apex 4.1.1 oracle 11g
    create or replace procedure email ( p_email  in    varchar2)
    is
        l_workspace_id      number;
        l_subject           varchar2(2000);
        l_body              clob;
        l_body_html         clob;
         l_email varchar2(40);
    begin
        l_workspace_id := apex_util.find_security_group_id (p_workspace => 'xyz');
        apex_util.set_security_group_id (p_security_group_id => l_workspace_id);
    l_email:= p_email;
        l_body := ' ';
        l_subject := 'You have new tasks';
        --if l_email=:P3_CONFIRM_EMAIL_ADDRESS is not null then
       -- email( l_email =>:P3_CONFIRM_EMAIL );
    -- end if;
            l_body_html := '<p />The following tasks have been added.';
         apex_mail.send (
                p_to        => l_email ,
                p_from      => '[email protected]',
                p_body      => l_body,
                p_body_html => l_body_html,
                p_subj      => l_subject );
      APEX_MAIL.PUSH_QUEUE;
    end; I also check the log and queue but both are empty,
    select * from
    apex_mail_queue
    select * from
    apex_mail_log Kindly suggest what to do ?
    I also created a process in apex , which call this procedure and pass the email address entered by user.

  • How To Build an E-mail option in apex .

    hi friends
    How Can i send mail to client via using apex.
    How can i do this.
    Any One could tell me or send me any Packaged Application or Instraction to sent e-mail.
    Thanks
    Manoj

    This is a modified example I am using:
    CREATE OR REPLACE PROCEDURE stu_email_confirmation (
       p_stu_email_id   IN   NUMBER,
       p_stu_id         IN   NUMBER,
       p_stu_session    IN   VARCHAR2
    IS
       v_text   VARCHAR2 (4000);
    BEGIN
       FOR c IN (SELECT stu_id, stu_first_name, stu_last_name, stu_email,
                        stu_num_spaces
                   FROM edu_students
                  WHERE stu_id = p_stu_id)
       LOOP
          v_text :=
                'Hello '
             || c.stu_first_name
             || ' '
             || c.stu_last_name
             || CHR (10)
             || CHR (10)
             || c.stu_email
             || CHR (10)
             || CHR (10)
             || 'Regards.';
       END LOOP;
       wwv_flow_api.set_security_group_id (apex_util.find_security_group_id ('OC'));
       apex_mail.send (p_to           => c.stu_email,
                       p_from         => '[email protected]',
                       p_body         => v_text,
                       p_subj         => 'Hello',
                       p_cc           => NULL,
                       p_bcc          => NULL,
                       p_replyto      => NULL
    END stu_email_confirmation;Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

  • Send Mail is not working

    Hi,
    I have installed Oracle Apex 3.2 on Oracle 10G Enterprise Edition database, Using Glassfish Server and apex listener
    I have configured the SMTP on my machine. And added this SMTP host address and port in the admin instance setting.
    When I run the below code mails are not getting triggered. What might be the issue in this setting. Need your suggestion in order to make work of send mails.
    DECLARE
    v_subject VARCHAR2(100);
    v_sender VARCHAR2(100);
    v_recipient VARCHAR2(100);
    v_cc VARCHAR2(100);
    v_bcc VARCHAR2(100);
    v_body VARCHAR2(4000);
    v_body_html VARCHAR2(4000);
    BEGIN
    v_subject := 'Email Subject';
    v_sender := '[email protected]';
    v_recipient := '[email protected]';
    v_cc := '';
    v_bcc := '';
    v_body := 'Some text' || chr(10) || 'more text here';
    v_body_html := 'Some text
    more text here';
    -- Send plain text email
    APEX_MAIL.SEND(
    P_TO => v_recipient,
    P_FROM => v_sender,
    P_CC => v_cc,
    P_BCC => v_bcc,
    P_SUBJ => v_subject,
    P_BODY => v_body);
    -- Send HTML email
    APEX_MAIL.SEND(
    P_TO => v_recipient,
    P_FROM => v_sender,
    P_CC => v_cc,
    P_BCC => v_bcc,
    P_SUBJ => v_subject,
    P_BODY => v_body,
    P_BODY_HTML => v_body_html);
    APEX_MAIL.PUSH_QUEUE;
    END;

    I am also facing issue with email send .
    apex 4.1.1 oracle 11g
    create or replace procedure email ( p_email  in    varchar2)
    is
        l_workspace_id      number;
        l_subject           varchar2(2000);
        l_body              clob;
        l_body_html         clob;
         l_email varchar2(40);
    begin
        l_workspace_id := apex_util.find_security_group_id (p_workspace => 'xyz');
        apex_util.set_security_group_id (p_security_group_id => l_workspace_id);
    l_email:= p_email;
        l_body := ' ';
        l_subject := 'You have new tasks';
        --if l_email=:P3_CONFIRM_EMAIL_ADDRESS is not null then
       -- email( l_email =>:P3_CONFIRM_EMAIL );
    -- end if;
            l_body_html := '<p />The following tasks have been added.';
         apex_mail.send (
                p_to        => l_email ,
                p_from      => '[email protected]',
                p_body      => l_body,
                p_body_html => l_body_html,
                p_subj      => l_subject );
      APEX_MAIL.PUSH_QUEUE;
    end; I also check the log and queue but both are empty,
    select * from
    apex_mail_queue
    select * from
    apex_mail_log Kindly suggest what to do ?
    I also created a process in apex , which call this procedure and pass the email address entered by user.

  • Mailqueue cannot be pushed

    Hi,
    I have a problem with the APEX mail queue. It cannot be pushed. The mails just stand there.
    Things that I have tried:
    1) Tried to push the mails via the internal Workspace Administration
    2) Tried to push it via the command line as the schema assigned to the workspace:
    begin
      wwv_flow_api.set_security_group_id(apex_util.find_security_group_id('TPG'));
      apex_mail.push_queue;
      commit;
    end;
    /3) No errors in the log
    SELECT   *
      FROM   apex_mail_queue
    WHERE   mail_send_error IS NOT NULL;We did have a problem with the database job (DBMS_JOB) pushing the mail queue in the FLOWS_ schema. The job was running for 20 days and not finishing. Perhaps an os process was hanging. The DBAs fixed the problem, don't know what they did. But the job now looks fine.
    We have APEX 3.1.2 installed on a 10.2.0.1 RAC (two nodes on Solaris).
    Any ideas / suggestions? I ran out of options to check.
    Also, the basic smtp gateway functionality works, too. I have been able so send a basic email using UTL_SMTP from the same schema. Thus privileges and smtp connectivity as such work (even from the database).
    Thanks,
    ~Dietmar.

    Hi,
    When we had a similar issue we resolved it by following advice such as: [http://it.toolbox.com/blogs/database-solutions/killing-the-oracle-dbms_job-6498] Even though we could fix a job, we needed to restart the job queue processes as well to get them going again. There were also issues with emails in the queue that didn't have valid email addresses (mostly NULLs) - these were manually deleted by my DBA. After this, the jobs started running ok.
    Andy

  • Email in the queue not sent

    Hi All Apex friends
    I am using 4.2 on glassfish ,linux ,oracle 11 g
    I am trying to make send email work
    create or replace procedure email ( p_email  in    varchar2)
    is
        l_workspace_id      number;
        l_subject           varchar2(2000);
        l_body              clob;
        l_body_html         clob;
         l_email varchar2(40);
    begin
        l_workspace_id := apex_util.find_security_group_id (p_workspace => 'xyz');
        apex_util.set_security_group_id (p_security_group_id => l_workspace_id);
    l_email:= p_email;
        l_body := ' ';
        l_subject := 'You have new tasks';
        --if l_email=:P3_CONFIRM_EMAIL_ADDRESS is not null then
       -- email( l_email =>:P3_CONFIRM_EMAIL );
    -- end if;
            l_body_html := '<p/>The following tasks have been added.';
         apex_mail.send (
                p_to        => l_email ,
                p_from      => '[email protected]',
                p_body      => l_body,
                p_body_html => l_body_html,
                p_subj      => l_subject );
      APEX_MAIL.PUSH_QUEUE;
    end;
    select * from apex_mail_queue
    select * from  apex_mail_logBoth the queries has my TEST email but it not pushing the queue out
    Kindly suggest what to do ?

    You may need to Enable Network Services in the 11g Database (or get your DBA to do this for you).
    I think the reason being in 11g, Oracle tightened the security so users that needed to access network credentials like LDAP and Email required specific privileges granted. Unfortunately it seems you can’t grant it for the whole database, so it needs to be done for each schema/user on the database.
    See the APEX 4.2 Installation Guide, Setion 3.3.8 on 'Enabling Network Services'
    http://docs.oracle.com/cd/E37097_01/doc/install.42/e35123/otn_install.htm#BEHIFAJD
    Amanda.

  • Submiting a DB job in SQL developer for APEX workspace

    Hi,
    I am trying to run this procedure (which will be used to run a DB job daily) from SQL developer but i am getting some error:-
    declare
    cursor c1 is
    select *
    from ABC
    where to_date(STARTDATE, 'DD-MON-YY') = (to_date(sysdate,'DD-MON-YY') + 7);
    c_rec c1%rowtype;
    begin
    wwv_flow_api.set_security_group_id;
    open c1;
    loop
         fetch c1 into c_rec;
         exit when c1%NOTFOUND;
    schema.package.SEND_EMAIL(c1.ID);
    END LOOP;
    CLOSE C1;
    end;
    The error I am getting is 6502 ORA-06502: PL/SQL: numeric or value error . If i run the same thing from APEX, it works fine. Please help!!
    procedure send_email(p_id IN number)
    as
    cursor c2 is
         select *     
         from a,b
         where a.a_id =b.b_id
              and C_ID = p_id
    c2_rec c2%rowtype;
    begin
    wwv_flow_api.set_security_group_id;
         open c2;
         loop
              fetch c2 into c2_rec;
              exit when c2%notfound;
    apex_send_email(p_to => c2_rec.to,
    P_FROM => c2_rec.from,
    P_BODY => 'test',
    P_BODY_HTML => c2_rec.body_html,
    P_SUBJ => c2_Rec.sub,
         end loop;
         close c2;     
    end;

    Hi,
    >
    procedure set_security_group_id(
    p_security_group_id in number default null)
    -- This procedure allows the caller to set wwv_flow_security.g_security_group_id
    -- to the security group id of the schema they are currently running in.
    >
    When you call wwv_flow_api.set_security_group_id from SQL developer, you need pass p_security_group_id.
    Try e.g. something like this if you do not know what is your workspace id
    wwv_flow_api.set_security_group(APEX_UTIL.FIND_SECURITY_GROUP_ID (p_workspace=>'YOUR_WORKSPACE');Change YOUR_WORKSPACE to workspace name where your database schema is assigned
    Br,Jari

  • How to create an apex session in e.g. SQL*Plus?

    I would like to establish an apex session using a tool different from SQL Workshop.
    How can I achieve this using e.g. SQL*Plus or SQL Developer?
    Is there some document on the internet which addresses this question? I couldn't find it yet.

    First and foremost you need to set the Security Group ID (SGID)
    begin
    APEX_UTIL.SET_SECURITY_GROUP_ID(APEX_UTIL.FIND_SECURITY_GROUP_ID('MY_WORKSPACE'));  -- replace MY_WORKSPACE with yours
    end;
    then you might need to set an application_id for certain features to work:
    select application_id
        into apex_application.g_flow_id
        from apex_applications
       where application_name = 'my_app_name';  -- replace my_app_name with yours
    If you need to create a session id, you can get a fresh one with
    DECLARE
      VAL NUMBER;
    BEGIN
      VAL := APEX_CUSTOM_AUTH.GET_NEXT_SESSION_ID;
    END;
    Flavio
    http://oraclequirks.blogspot.com
    http://www.yocoya.com

Maybe you are looking for

  • IPhone not authorized to sync movie purchased on iMac

    I purchased a movie on my iMac using my apple id. When I sync my iPhone with my computer, I get a message saying that my device is not authorized to sync the movie. Can someone help me? Thanks!

  • Time capsule not getting power

    The power cable for my time capsule was recently chewed through, and the replacement cable I bought doesn't seem to be getting power. The time capsule dosen't light up at all. Does anyone have any ideas to help me?

  • A question about the create object command

    Hi, I met some problems when created type and view: In sqlplus, 1) I first create a address_ty: create or replace type address_ty as object (street varchar2(50), city varchar2(25), state char(2), zip number); type created 2) Then I created a person_t

  • No open billing quanityt has been determined

    Hi Experts, Can anyone help me with subject matter? Im creating an invoice in reference to oder with item cat TAS. Regards, Garpin

  • Transferring iTunes playlist from iPad to iPhone - using iCloud

    I'm trying to get playlists from my iPad to my iPhone 5, but without using iTunes since I'm not able to sync my iPhone 5 currently.  I do use iCloud, is there a way to sync playlists from one device to the other that way?  Or any other way without sy