APEX_UTIL.GET_PRINT_DOCUMENT  not returning anything

I have a report query and have provided a layout to print it
I need to get the html generated from the report so that I can mail it.
As I could not get the generated file in the PL/SQL package written , for quick testing I started testing using a SQL stmt to check for the length of the LOB
select dbms_lob.getlength(APEX_UTIL.GET_PRINT_DOCUMENT (
p_application_id=>my_app_id,
p_report_query_name=>'name of qry',
p_report_layout_name=>'name of layout',
p_report_layout_type=>'rtf',
p_document_format=>'htm')) lob_size
from dual
I also tried by providing the p_print_server => null in addition to the parameters passed.
But the query returns NULL only.
The qry and layout are correct as the query when tested in the edit qry screen in APEX shows the output report in the format required (including html , PDF etc)
Any pointers ?
Thx
Edited by: user618186 on Apr 24, 2009 2:35 PM
Edited by: user618186 on Apr 24, 2009 2:36 PM

I have the same problem exactly...works as an APEX proc, will not work from sqlplus despite setting security group id. Mail works. Attachments with another BLOB works. But I can't get this function to give me the BLOB.

Similar Messages

  • 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

  • Apex_util.get_print_Document not working outside apex environment

    I am working on one of the assignment in Apex 4.0.2 .
    The requirement is to dynamically generate reports and mail to User using the Scheduler program(Pl/sql) -> dbms_scheduler.
    I have used BI publisher to create the template and xml data for the report(Excel) and used Apex_util.get_print_Document
    in the scheduler program (which is written outside Apex), but this is not working properly,sends blank report to email.
    Please suggest how to set the apex session and use Apex_util.get_print_Document to work properly outside apex env.

    Apex (PL/SQL web-enabled) code needs to execute inside an Oracle server session that has been properly and correctly initialised for executing web enabled PL/SQL code.
    An example of how to execute such PL/SQL by intialising a proper environment, is shown in {message:id=2251131}.
    Note that this will not be able to execute Apex pages (via the flow engine) that are not public - that needs a proper authenticated Apex web session. Which could be a tad complex to emulate in this fashion.

  • Apex_util.get_print_document not generating correct output

    hello,
    Basically what I've done is this.
    1) stored a very simple xml file in a clob field called xml_file_clob in a table called xml_test1
    2) stored an rtf file in a clob field called rtf_layout in a table called xml_test1
    3) created a procedure (below) called generate_report_as_blob which attempts to combine the xml and layout and generate a PDF from it which is stored into a blob field in the same table where 1) and 2) are above .....
    4) I have confirmed that taking the clobs in 1) and 2) from the table above and creating xml and rtf files on my desktop that I can open the rtf file in Word, load the xml file and preview it and it does render the pdf as intended (so I think my clobs in the table are good)
    5) run the procedure below. It compiles and runs with no errors but generates a file into the blob column that when downloaded to my desktop looks like the below output (when opening w/ pdf it says there was an error opening the file)
    Any thoughts are greatly appreciated. I feel like I'm really close and am excited about what I could do with this if this can work.
    Thanks in advance, KW
    =========================================================================
    MY PROC
    ============================
    procedure generate_report_as_blob is
    v_xml xmltype;
    rtf_layout clob;
    v_rpt_output blob;
    v_xml_rpt_data clob;
    begin
    select xml_file_clob, rtf_layout_clob
    into v_xml_rpt_data, rtf_layout
    from xml_test1
    where xml_id = 2;
    v_rpt_output :=
    apex_util.get_print_document(p_report_data => v_xml_rpt_data
    ,p_report_layout => rtf_layout
    ,p_report_layout_type => 'rtf'
    ,p_document_format => 'pdf'
    ,p_print_server => null);
    update xml_test1
    set rpt_pdf_output = v_rpt_output
    where xml_id = 2;
    commit;
    end generate_report_as_blob;
    ==========================================================================
    ==========================================================================
    MY OUTPUT (as apdf file) :
    =================
    %PDF-1.4
    1 0 obj
    <<
    /Type /Catalog
    /Pages 3 0 R
    >>
    endobj
    2 0 obj
    <<
    /Type /Info
    /Producer (Oracle BI Publisher 10.1.3.4.0)
    >>
    endobj
    3 0 obj
    <<
    /Type /Pages
    /Kids [
    /Count 0
    >>
    endobj
    4 0 obj
    <<
    /ProcSet [ /PDF /Text ]
    >>
    endobj
    xref
    0 5
    0000000000 65535 f
    0000000010 00000 n
    0000000065 00000 n
    0000000147 00000 n
    0000000208 00000 n
    trailer
    <<
    /Size 5
    /Root 1 0 R
    /Info 2 0 R
    /ID [<fdd8d0c54769561cc797a7c9d0ae42cd><fdd8d0c54769561cc797a7c9d0ae42cd>]
    >>
    startxref
    258
    %%EOF
    ====================================
    Edited by: Ken Wood on Oct 30, 2009 8:56 AM

    I have the same problem exactly...works as an APEX proc, will not work from sqlplus despite setting security group id. Mail works. Attachments with another BLOB works. But I can't get this function to give me the BLOB.

  • Why does my function not return anything when I create as a schema object

    I have user ABC who owns several tables some of which have foreign key constraints.
    I have user XYZ that has been granted access to all tables owned by user ABC.
    When I create a function as user XYZ using following I get no return when I issue:
    select XYZ.ztm_tables_depended_on('ABC', 'A_TABLE_OWNED_BY_ABC') from dual :
    Please see after function definition.
    CREATE OR REPLACE FUNCTION ZTM_TABLES_DEPENDED_ON(p_Owner VARCHAR2, p_Table_Name VARCHAR2) RETURN VARCHAR2 IS
      CURSOR C1 IS
      SELECT OWNER, CONSTRAINT_NAME, R_OWNER, R_CONSTRAINT_NAME
      FROM   ALL_CONSTRAINTS
      WHERE  OWNER           = p_Owner
      AND    TABLE_NAME      = p_Table_Name
      AND    CONSTRAINT_TYPE = 'R'
      ORDER  BY OWNER, CONSTRAINT_NAME, R_OWNER, R_CONSTRAINT_NAME;
      v_Referenced_Owner       VARCHAR2(31);
      v_Ret_Val                VARCHAR2(4000);
      FUNCTION CONSTRAINT_TABLE_NAME(p_Owner VARCHAR2, p_Constraint_Name VARCHAR2) RETURN VARCHAR2 IS
        CURSOR C1 IS
        SELECT TABLE_NAME
        FROM   ALL_CONSTRAINTS
        WHERE  OWNER           = p_Owner
        AND    CONSTRAINT_NAME = p_Constraint_Name;
        v_Ret_Val ALL_CONSTRAINTS.TABLE_NAME%TYPE;
      BEGIN
        OPEN  C1;
        FETCH C1 INTO v_Ret_Val;
        CLOSE C1;
        RETURN v_Ret_Val;
      END;
    BEGIN
      FOR R IN C1 LOOP
        IF (R.OWNER <> R.R_OWNER) THEN v_Referenced_Owner := R.R_OWNER || '.';
        ELSE                           v_Referenced_Owner := NULL;
        END IF;
        v_Ret_Val := v_Ret_Val || ', ' || v_Referenced_Owner || CONSTRAINT_TABLE_NAME (R.R_OWNER, R.R_CONSTRAINT_NAME);
      END LOOP;
      RETURN LTRIM(v_Ret_Val, ', ');
    END;
    But, if I embed the function within an anonymous block as follows, I get results:
    DECLARE
      CURSOR C1 IS
      select owner, table_name
      FROM   all_tables where owner = 'ABC';
      FUNCTION ZTM_TABLES_DEPENDED_ON(p_Owner VARCHAR2, p_Table_Name VARCHAR2) RETURN VARCHAR2 IS
        CURSOR C1 IS
        SELECT OWNER, CONSTRAINT_NAME, R_OWNER, R_CONSTRAINT_NAME
        FROM   ALL_CONSTRAINTS
        WHERE  OWNER           = p_Owner
        AND    TABLE_NAME      = p_Table_Name
        AND    CONSTRAINT_TYPE = 'R'
        ORDER  BY OWNER, CONSTRAINT_NAME, R_OWNER, R_CONSTRAINT_NAME;
        v_Referenced_Owner       VARCHAR2(31);
        v_Ret_Val                VARCHAR2(4000);
        FUNCTION CONSTRAINT_TABLE_NAME(p_Owner VARCHAR2, p_Constraint_Name VARCHAR2) RETURN VARCHAR2 IS
          CURSOR C1 IS
          SELECT TABLE_NAME
          FROM   ALL_CONSTRAINTS
          WHERE  OWNER           = p_Owner
          AND    CONSTRAINT_NAME = p_Constraint_Name;
          v_Ret_Val ALL_CONSTRAINTS.TABLE_NAME%TYPE;
        BEGIN
          OPEN  C1;
          FETCH C1 INTO v_Ret_Val;
          CLOSE C1;
          RETURN v_Ret_Val;
        END;
      BEGIN
        FOR R IN C1 LOOP
          IF (R.OWNER <> R.R_OWNER) THEN v_Referenced_Owner := R.R_OWNER || '.';
          ELSE                           v_Referenced_Owner := NULL;
          END IF;
          v_Ret_Val := v_Ret_Val || ', ' || v_Referenced_Owner || CONSTRAINT_TABLE_NAME (R.R_OWNER, R.R_CONSTRAINT_NAME);
        END LOOP;
        RETURN LTRIM(v_Ret_Val, ', ');
      END;
    BEGIN
      FOR R IN C1 LOOP
        DBMS_OUTPUT.PUT_LINE(ztm_tables_depended_on(R.Owner, R.Table_Name));
      END LOOP;
    END;
    Any ideas what is happening here?

    Any ideas what is happening here?
    Justin explained the probable reason.
    See the 'How Roles Work in PL/SQL Blocks' section of the database security doc for the details
    http://docs.oracle.com/cd/E25054_01/network.1111/e16543/authorization.htm#i1007304
    How Roles Work in PL/SQL Blocks
    The use of roles in a PL/SQL block depends on whether it is an anonymous block or a named block (stored procedure, function, or trigger), and whether it executes with definer's rights or invoker's rights.
    Roles Used in Named Blocks with Definer's Rights
    All roles are disabled in any named PL/SQL block (stored procedure, function, or trigger) that executes with definer's rights. Roles are not used for privilege checking and you cannot set roles within a definer's rights procedure.
    The SESSION_ROLES view shows all roles that are currently enabled. If a named PL/SQL block that executes with definer's rights queries SESSION_ROLES, then the query does not return any rows.
    Roles Used in Named Blocks with Invoker's Rights and Anonymous PL/SQL Blocks
    Named PL/SQL blocks that execute with invoker's rights and anonymous PL/SQL blocks are executed based on privileges granted through enabled roles. Current roles are used for privilege checking within an invoker's rights PL/SQL block. You can use dynamic SQL to set a role in the session.
    See that line starting with 'All roles are disables in any named PL/SQL block'?

  • Echo $ORACLE_HOME not returning anything

    Hello,
    We are an Oracle On Demand customer , when i try to login to host using putty and try to find the Oracle Home using the command
    # echo $ORACLE_HOME ,
    it doesnt return anything. Is there any configuration that is missing, any help will be appreciated.
    I tried modifying the .bash_profile file by adding
    ORACLE_HOME=$ORACLE_BASE/product/10.2.0
    export ORACLE_HOME
    but still no luck.

    Poking about on the intertubes, I found an Oracle On Demand Technology reference guide (but probably from a different version). Anyways, it has an appendix where all the conventions about setting ORACLE_BASE, ORACLE_HOME and SID are found. You should find that guide for your circumstance, there appears to be a lot of conventions based on things you haven't mentioned.
    Remember, filenames beginning with a dot are hidden (I don't use filezilla so I don't know how it handles that), and some systems are set up with more general environment settings set elsewhere than your .bashrc. You may simply need to dot some other file or use oraenv to condition your settings, or need to create a .bashrc or some other shell specific file.

  • Queries in SQL developper do not return anything?

    Hello there,
    First of I am completely new to Oracle and IT in general. Apart from having used computers since the heyday my knowledge of programming is very little. I have been reading Oracle documentation and bought the CBT nuggets tutorials to prepare for examination.
    I have followed the instructions to install the HR schema which worked in SQL*Plus but whenever i go into SQL developper and create a connection using the same username/password as I did in SQL*plus, then type in the select table_name from user_tables; query, nothing happens.
    What am I doing wrong? Am i simply not connecting to the same DB?
    Thanks in advance

    So when i set up the HR schema using SQL plus and was prompted to give a password for HR, i did that. Now when i open up the SQL plus (as administrator) and log in using username HR and the password i set for it, I can access the Schema's default tables such as employees.
    However on SQL developper, I open up a new connection called HR and put the same password that HR uses on SQL plus but whenever I attempt a select statement there are no returns. It just seems like SQL developper is not connected to the database.
    I am currently using the CBT nuggers tutorial for the fundamentals exam 1z0-051 and the tutorial uses both SQL developer and SQL plus.
    I appreciate all the responses but unfortunately I am stuck :(
    I get this message when i go to Query builder:
    Text is not a valid, single SELECT statement.
    Syntax Error at line 4, column 9
    select * employees;
    ^^^
    Expected: ',','BULK','FROM','INTO',BULK_COLLECT_opt,from_clause,into_list,
    Query Builder disabled.
    Edited by: Vlakarmis on Jan 2, 2013 7:04 AM

  • Java Perpared Statement does not return anything

    Sorry fo bad language.
    I have connection with Oracle 8 with JDBC thin drivers. Almost all queries, simple and very complex are doing well, except one:
    select srcCard.object_id
    from objects srcCard, params attrs
    where
    attrs.attr_id = ?
    and attrs.object_id = srcCard.object_id and
    attrs.value=?
    union
    select srcCard.object_id
    from objects srcCard
    where project_id = ? and
    object_type_id in (
    select object_type_id
    from object_types
    start with object_type_id=?
    connect by prior object_type_id=parent_id )
    and srcCard.name=?
    Such query get parameters and don't return anywhere. Java waited for 48 hours and still continue to wait results from Oracle. If I look at sessions list in Oracle (with DBA studio), there is no such query.
    The most strange thing is: query is not work only in Weblogic. If I try to run it with sql navigator or with sqlplus it returns data normally (with extract equal arguments).
    Where is the bug? Is it known bug of driver, Oracle or configuration of Oracle?

    Hi, Jason,
    user11925071 wrote:
    Hello All,
    I have a 8i DB and SQL Plus. in SQL Plus, when I do "desc cat", it gave me this:
    SQL> desc cat;
    Name Null? Type
    TABLE_NAME NOT NULL VARCHAR2(30)
    TABLE_TYPE VARCHAR2(11)
    However when I do "select * from cat;", I though I would get a list of tables, but instead I got "no rows selected". Why is that?The most likely reason is that the table has no data.
    Try:
    SELECT  COUNT (*)
    FROM    cat;to check.
    And the second question is very likely related to the first. I can "desc user_constraints" but when I tried to select some constraints, I got error like this:
    SQL> select constraint_name, constraint_type from user_constraints where tname = 'county_of_use';
    select constraint_name, constraint_type from user_constraints where tname = 'county_of_use'
    ERROR at line 1:
    ORA-00904: invalid column nametname is not a column in user_constraints. Perhaps you meant table_name.
    Text inside quotes is case-sensitive. Most names are all upper-case, so you proabably want to say
    SELECT  constraint_name
    ,     constraint_type
    FROM     user_constraints
    WHERE     table_name       = 'COUNTY_OF_USE';Edited by: Frank Kulash on Sep 22, 2009 5:12 PM
    Originally said "you probably want to say constraint_name'. I agree with the next 2 replies; table_name is more likely.

  • Re: AJAX-get() not returning anything

    Hello!
    I have the function listed below.
    <script language="JavaScript1.1" type="text/javascript">
    function getJob(callObj,setObj,pWhat) {
    var get = new htmldb_Get(null, &APP_ID.,
    'APPLICATION_PROCESS=getJob', 0);
    alert("Here now plz");
    get.add('P3_EMPNO',callObj.value)
    var gReturn= get.get();
    if(gReturn && pWhat == 'OBJ')
    { html_GetElement(setObj).value = gReturn }
    else if (gReturn && pWhat == 'DIV')
    { html_GetElement(setObj).innerHTML = gReturn }
    else
    { html_GetElement(setObj).value = 'null' }
    get = null;
    </script>
    I also have this application process with this text
    declare
    v_job varchar2(10);
    begin
    select job
    into v_job
    from emp
    where empno = :P3_EMPNO;
    htp.prn(v_job);
    end;
    The get.add() in my function works and sets the cache value for :P3_EMPNO but the get.get() seems not to return any value so nothing is eventually displayed. Might u guys know where i'm messing it up.
    Thnx in adv

    So i added an alert in one of the ifs and concatenated with gReturn and confirmed that the get() is actually working.
    <script language="JavaScript1.1" type="text/javascript">
    function getJob(callObj,setObj,pWhat) {
    var get = new htmldb_Get(null, &APP_ID.,
    'APPLICATION_PROCESS=getJob', 0);
    alert("Here now plz----1");
    get.add('P3_EMPNO',callObj.value)
    var gReturn= get.get();
    if(gReturn && pWhat == 'OBJ')
    { html_GetElement(setObj).value = gReturn;
    alert("OK, Here now plz----1"+gReturn);}
    else if (gReturn && pWhat == 'DIV')
    { html_GetElement(setObj).innerHTML = gReturn }
    else
    { html_GetElement(setObj).value = 'null' }
    get = null;
    </script>
    So how do i display html_GetElement(setObj).value in an item on the form?
    Thnx!

  • Cfldap not returning anything

    I am trying to use cfldap to retireve a user's AD
    information. I have confirmed that I am using the correct server,
    username, password, and start path. But, it always returns a blank,
    no data. Yet, I get no errors. If I do a cfdump, there is no data.
    I am at a loss. At least with an error message I would have
    something to work with. Does anyone have any suggestions or ideas
    on why I would get an empty record with no errors? My code is as
    below:

    Tricks I use with LDAP.
    1) Simplify your attributes, only select CN or * until you
    know you are
    retrieving the desired node, then add all the other elements.
    2) Try without a filter until you confirm the desired node(s)
    are being
    returned, then add the filter.
    3) Try other scopes. Maybe there are no sub nodes to the node
    you have
    mapped to.
    4) A third party LDAP browsers helps me a great deal to make
    sure I am
    understanding the LDAP data correctly. I use the Softerra
    free LDAP
    browser.

  • Ldapsearch_s does not return anything

    Hi,
    I try to use the code below, but somehow retval is always 0. Any idea?
         ldap_user := 'cn=orcladmin';
         ldap_passwd:= 'welcome';
         ldap_base := ' '; --'cn=Login Server (portal30_sso)';     
         v_session := DBMS_LDAP.init(ldap_host, ldap_port);     
         retval := DBMS_LDAP.simple_bind_s(v_session,ldap_user, ldap_passwd);
         my_attrs(1) := 'userpassword';
         retval := DBMS_LDAP.search_s(v_session,
                   ldap_base,
                   DBMS_LDAP.SCOPE_SUBTREE,
                   'objectclass=*', --'cn=TURKER',
                   my_attrs,
                   0,
                   my_message);     
    Thanks.

    Hi Nilay:
    Can you tell me more about your environment. Im trying to reproduce this on my system. How are you executing this code?
    Can you give me step by step what you are doing.
    Thanks,
    Jay

  • I,ve been trying to use the "IMAQ Count Objects" but it seems it does not return anything. I,m not sure if i need a grayscale image as an input? anyone can help

    Any more information on :IMAQ Count Objects" vi?

    It looks like you are correct. I was thinking of the input to "Complex Measure", which requires the binary image. I started with IMAQ back when we had to chain all the routines together ourselves, instead of having a single vi that did everything for us.
    Bruce
    Bruce Ammons
    Ammons Engineering

  • F4_FILENAME_SERVER is not returning any value

    Dear All,
    I want a popup for the application server from where I can select file for further processing. I have used F4_FILENAME_SERVER, but the function module is not working. It is giving a popup with the filenames but after selection of a particular file if I select the check button, it is not returning anything (coming blank). Please can you suggest anything on this.
    Thanks and regards,
    Atanu

    Try using FM: /SAPDMC/LSM_F4_SERVER_FILE
    *** Display Directories on the Application Server
         CALL FUNCTION '/SAPDMC/LSM_F4_SERVER_FILE'
              EXPORTING
                DIRECTORY         = <directory_name>
    *   filemask               = ''
             IMPORTING
                SERVERFILE        = P_FILE
             EXCEPTIONS
                CANCELLED_BY_USER = 1
                OTHERS            = 2.
         IF SY-SUBRC <> 0.
            MESSAGE W016 WITH P_FILE.
         ENDIF.
    Kind Regards
    Eswar

  • Point cloud clip doesn't return anything in the result table

    Hi experts,
    I am wondering why my point cloud clipping function does not return anything into the result table.
    The boundaries of my point cloud are:
    min long 316,500
    max long 316,643.21
    min lat 234,000
    max lat 234,105.38
    min elevation -4.79
    max elevation 30.87
    For the ind_dimquery I have tried different geometry types, like 3003 and 3008, usually with the elem_info_array (1,1007,3)
    like in the following example:
    SQL> declare
    2 inp sdo_pc;
    3 begin
    4 select pc into inp from base109 where rownum=1;
    5 insert into restst
    6 select * from table(sdo_pc_pkg.clip_pc(
    7 inp,
    8 sdo_geometry(3003, 29903, null,
    9 mdsys.sdo_elem_info_array(1,1007,3),
    10 mdsys.sdo_ordinate_array(316510, 234080, -3, 316550, 234100, 2)),
    11 null, null, null, null));
    12 end;
    13 /
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.20
    SQL> select count(*) from restst;
    COUNT(*)
    0
    What am I doing wrong? This should be a query window within the right area and I know that at least one point lies within this defined window.
    Any help is greatly appreciated!!!!!
    Cheers,
    F.

    yes exactly, I have tried all of this already.
    For a further example, there is a point in:
    POINTS(SDO_GTYPE, SDO_SRID, SDO_POINT(X, Y, Z), SDO_ELEM_INFO, SDO_ORDINATES)
    R G B I POINT_ID
    SDO_GEOMETRY(3001, 29903, SDO_POINT_TYPE(316503.49, 234089.46, 3.32), NULL, NULL
    71 91 78 70 55
    so theoretically, I'd feel that at the VERY LEAST this point should be in the 3008geometry and 1007 elem array for the coordinates for xmin, y min, zmin, xmax, ymax, zmax for
    316500, 234080, 2, 316510, 234100, 5
    but...nothing. Nothing in the result table.
    For full query:
    SQL> declare
    2 inp sdo_pc;
    3 begin
    4 select pc into inp from base109 where rownum=1;
    5 insert into restst
    6 select * from table(sdo_pc_pkg.clip_pc(
    7 inp,
    8 sdo_geometry(3008, 29903, null,
    9 mdsys.sdo_elem_info_array(1,1007,3),
    10 mdsys.sdo_ordinate_array(316500, 234080, 2, 316510, 234100, 5)),
    11 null, null, null, null));
    12 end;
    13 /
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.13
    SQL> select count(*) from restst;
    COUNT(*)
    0

  • 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

Maybe you are looking for