Apex_util.get_print_document in sql developer

I have not been successful in getting apex_util.get_print_document to work in sql developer, the return value is always null and inserted into the table. Inside of APEX it works fine, so I figured I had to set workspace id, but that did not help. Heres the basic code.
declare
rpt_blob BLOB;
begin
wwv_flow_api.set_security_group_id(my ws id);
rpt_blob := APEX_UTIL.GET_PRINT_DOCUMENT (
p_application_id => 122,
p_report_query_name => 'NYARNG_unit',
p_report_layout_name => 'TEST',
p_report_layout_type => 'xsl-fo',
p_document_format => 'pdf',
p_print_server => null);
insert into report_archive_tbl values ('test'||sysdate||'.pdf','application/pdf',rpt_blob,sysdate,'tread');
end;

Try
wwv_flow_api.set_security_group_id;instead of wwv_flow_api.set_security_group_id(my ws id);
Regards,
Hari

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 with bind

    All,
    I'm trying to create a process to bulk print a report to the file system using the API apex_util.get_print_document. Is there a way to pass bind variables to the report query when using this API? If not, has anyone come up w/another solution on mass printing reports that have parms?
    Thanks,
    Paul

    Hi Paul,
    APEX_UTIL API consists of 4 different GET_PRINT_DOCUMENT Functions based on parameters types(Function Overloading) that are being passed. If you look at the function where CLOB is the data type for parameter p_report_data, the bind variables can be passed to the SQL which willl be used by DBMS_XMLGEN or other XML/CLOB generation API's.
    I have used DBMS_XMLGEN to generate the CLOB data which intern used by GET_PRINT_DOCUMENT function.
    Regards
    Shesh

  • Apex_util.get_print_document results in "503-service unavailable"

    I'm using APEX 4.2.0.3.00.08 with GlassFish 3.1.2.2 on an Oracle 10.2.0.5 database.
    Recently I created a report-query together with a xsl-fo report-layout created in Altova Stylevision. I've enabled and configured print-options and when I press my application button, I'm perfectly capable of viewing and/or saving the pdf-version of my report.
    Additionally I want to save my report as BLOB in the database, but when I try this using apex_util.get_print_document, all I get in my table is a html-page containing the message "503-service unavailable".
    I used the following page as reference:
    Creating High Fidelity PDF Reports with Oracle Application Express but apparently I'm missing something or doing something wrong......I truly hope there's someone out here to help me!!
    Thanks in advance!

    Hello Mike,
    I've been trying to create an application on apex.oracle.com to reproduce the problem, but I can't seem to get it to work.
    I've uploaded a very simple layout created in StylusStudio, a simple query on the EMP-table only containgin FIRST_NAME, LAST_NAME and EMAIL and when I add the layout to the query and press "Test report", it works fine.
    When I run the report from my application, it only shows a pdf with a thick, horizontal lines, like it's showing only empty cell borders.
    Meanwhile I found out that the APEX-listener keeps reporting similair errors, even when I use that same simple stylesheet (created with StylusStudio) on the EMP-table, even when the stylesheet does not contain any special characters at all. In stead of the message starting with INFO: Character decoding failed. Parameter [#x200B;</xsl:text> , it then ignores the complete xslt-stylesheet (the complete contents of the stylesheet is between the brackets, in stead of just the string containg the special chars).
    To be honest I'm a little lost now. First my focus was on how to get rid of the special characters, but now it looks like, even when I might succeed in that, it doesn't even solve my problem.
    Any idea why my application doesn't show me the same report I see when testing the report-query?
    The application can be found here:
    https://apex.oracle.com/pls/apex/htmldb/f?p=29586
    The bottom region is an attempt to show the pdf with the highest id, but I think it does not show the actual pdf (http-404)
    The source for that PL/SQL region is:
    declare
      src_  varchar2(256);
      mime_ varchar(48);
      id_   number;
    begin
    select max(id)
    into id_
    from report_archive;
        select mimetype
          into mime_
          from report_archive
         where id = id_;
        src_ := 'src="#OWNER#.download_doc?i_doc_id=' || id_ || '" ';
        htp.p('<div style="">');
        if instr(mime_,'pdf') > 0 then
          htp.p('<embed height="800" width="1200" name="statement" ');
        elsif instr(mime_,'excel') > 0 then
          htp.p('<embed height="800" width="1200" name="statement" ');
        else
          htp.p('<embed height="800" name="statement" ');
        end if;
        htp.p(src_);
        htp.p('type="' || mime_ || '" />');
        htp.p('</div>');
    exception
       when no_data_found then
          null;
    end;
    I really hope we can solve this!!!!
    Best regards,
    Marco

  • 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.

  • Using apex_util.get_print_document with DBMS Scheduler

    I'm trying to run report_query from DBMS_SCHEDULER job. When the job tries to execute I get this error in dba_scheduler_job_run_details. Notsure how to debug this. Any ideas?
    Select error#, additional_info from dba_scheduler_job_run_details where job_name ='TEST10'
    6502
    ORA-06502: PL/SQL: numeric or value error
    ORA-06512: at "APEX_030200.WWV_FLOW_RENDER_QUERY", line 644
    ORA-01003: no statement parsed
    ORA-06512: at "APEX_030200.WWV_FLOW_RENDER_QUERY", line 1469
    ORA-06512: at "APEX_030200.WWV_FLOW_UTILITIES", line 9233
    ORA-06512: at "APEX_030200.HTMLDB_UTIL", line 1836
    ORA-06512: at "SIS_EXPRESS.SIS_EXPRESS_REPORTS", line 867
    ORA-06512: at line 2
    DECLARE l_report_blob blob;
    l_id number;
    l_application_id report_scheduler_job.application_id%TYPE;
    l_application_owner report_scheduler_job.application_owner%TYPE;
    l_report_query_name report_scheduler_job.report_query_name%TYPE;
    l_report_layout_name report_scheduler_job.report_layout_name%TYPE;
    l_output_format varchar2(10);
    BEGIN
    l_report_blob := apex_util.get_print_document(
    p_application_id => l_application_id,
    p_report_layout_name => l_report_layout_name,
    p_report_query_name => l_report_query_name,
    p_report_layout_type => l_output_format,
    p_document_format => l_output_format,
    p_print_server => null);
    END:

    You must use a "replace" function in you sql querie for the special characters. for example:
    select replace(replace(customer_name,''&'',''%26amp;''),chr(39),''%26apos;'') customer_name
       from accounts

  • Running apex_util.get_print_document with APEX_MAIL

    I am trying to automate the running of an apex_util.get_print_document, emailing the output to my users. When the job tries to run I get this error in the log:
    ORA-20022: Null value supplied for parameter p_attachment.
    ORA-06512: at "FLOWS_030100.WWV_FLOW_MAIL", line 731
    ORA-06512: at "SIS_EXPRESS.SIS_EXPRESS_REPORTS", line 154
    ORA-06512: at line 2
    Not sure where I can check this to see the problem. Anybody do this before?
    BEGIN
    l_report_blob := apex_util.get_print_document(
    p_application_id => l_application_id,
    p_report_layout_name => l_report_query_name,
    p_report_query_name => l_report_query_name,
    p_report_layout_type => l_output_format,
    p_document_format => l_output_format,
    p_print_server => null);
    l_id := APEX_MAIL.SEND( p_to => '[email protected]',
    p_from => '[email protected]',
    p_subj => 'APEX_MAIL with attachment',
    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_report_blob,
    p_filename => l_report_query_name,
    p_mime_type => l_mime_type);
    COMMIT;
    END;

    Hi Paul,
    APEX_UTIL API consists of 4 different GET_PRINT_DOCUMENT Functions based on parameters types(Function Overloading) that are being passed. If you look at the function where CLOB is the data type for parameter p_report_data, the bind variables can be passed to the SQL which willl be used by DBMS_XMLGEN or other XML/CLOB generation API's.
    I have used DBMS_XMLGEN to generate the CLOB data which intern used by GET_PRINT_DOCUMENT function.
    Regards
    Shesh

  • 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.

  • 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 print a something in oracle sql developer

    Hello all
    Do you know How to print a something in oracle sql developer? i mean for example in the query we write something, (offcourse i dont mean comments)
    thank u in advance.
    best

    1003209 wrote:
    Hello all
    Do you know How to print a something in oracle sql developer? i mean for example in the query we write something, (offcourse i dont mean comments)
    thank u in advance.
    bestDBMS_OUTPUT()

  • Oracle SQL Developer 1.0 is easy to install and use, and is portable

    I have tried the latest version of Oracle SQL Developer 1.0 and would like to share my experience of using it.
    Installation of Oracle SQL Developer 1.0
    Download from
    http://www.oracle.com/technology/software/products/sql/index.html?_template
    Unzip the Oracle SQL Developer for Windows (55.8 MB) to C:\sqldeveloper (103MB)
    Advantages: The unzip folder can be your removable disk and you can access Oracle
    anywhere provided that there is an Internet connection to Oracle Server.
    Unzip sqldeveloper-1557.zip to C:\ with folder name;
    double-click on sqldeveloper.exe in c:\sqldeveloper
    Click on [No]
    Tick all check boxes
    Click on [OK]
    Right-click on Connections, New
    Database Connection…
    Enter User name: SCOTT
    Password: TIGER
    Hostname: 127.0.0.1 (or IP of your Oracle Server on the Internet)
    SID: orcl
    If you want to connect to local Oracle user SYS,
    Enter User name: sys
    Password: ora10g_manager_password
    Hostname: 127.0.0.1
    SID: orcl
    Select Role: SYSDBA
    Click on [Connect]
    Right-click on Tables, Create Table
    Click on [Add Column]
    Select Type: NUMBER for COLUMN2
    Click on [OK]
    Table1 is created
    Click on TABLE1, click on “Data” tab
    Click on the “Green Plus” icon to insert record
    Click on “Commit Changes” icon
    Click on “DBConnection1” tab
    Enter: select * from table1;
    Click on “Execute Statement (F9)” icon
    To exit: Click on File, Exit

    Have you noticed that there's a forum dedicated to SQL Developer?
    C.

  • Engineer to Logical Model in SQL Developer EA4 causes problems

    I'm working with SQL Developer 3.0 EA4 (Build MAIN-03.97)
    Unfortunately I fond out, that it would be impossible to use the function " Engineer to Logical Model" any more after I change the relational model. In datamodeler.log I got the error message line "[AWT-EventQueue-0] ERROR MDBAction - java.lang.NullPointerException" for each time I use the function "Engineer to Logical Model". I try it out with the sample model "sh_cre_all.sql" and with following steps:
    1) Import via DDL File – no problem
    2) Engineer to Logical Model – no problem
    3) Change some attributes in the relational model – no problem
    4) Again Engineer to Logical Model – no problem
    5) Save, Exit an Open the sample – no problem
    6) Again Step 3 and 4 – no problem
    7) Add a table via drag&drop from an oracle schema – no problem
    8) Save, Exit an Open the sample – no problem
    9) Engineer to Logical Model no longer possible!!!
    Bernd

    I have experienced similar problems with 'Engineer to Logical model'.
    The scenario was following:
    Creating Logical model using 'Engineer to Logical model' from existing Relational model.
    Modifying the Relational model and 'Engineer to Logical model' again. No exception occured but the Logical model wasn't updated accordingly.
    Removing all entities from the Logical model.
    Trying to 'Engineer to Logical model' again. No entities were created in the Logical model (even after few tries).
    So I got to situation where I was unable to generate a Logical model, which was quite frustrating.
    The workaround was to create new Data Modeller project and import to it from the original project - the 'Engineer to Logical model' worked again.

  • Password change fails in SQL Developer with verify function...

    A couple of months ago I enforced a password verify function on our 11.2.0.3 databases and also one legacy 10.2.0.4 database.
    At the time I tested on my account (which had elevated privileges...doh!).   Now some users are hitting expiry, they can't change it via SQL Developer.
    If I create a user with 'create session' privilege and set their profile to one that uses the verify function (see both below), I then log in to SQL Developer (we have tried with versions 3.1 (Windows) and 3.2 (Linux) with same failure results.
    BTW,.. the password verify function enforces the following:
    password must be minimum of 8 characters
    password must not be the same as the user name, or user name (1-100)
    password must contain at least a single digit
    password must contain at least a single character
    1. Works = I log into the local server and run command line SQLPlus, type 'password' and update.   I can successfully change my password.
    2. Fails = I log into the local server and run command line SQLPlus, type 'alter user <me> identified by <newpwd>;' I get:
    TEST: SUTEMP > alter user sutemp identified by carport9999;
    alter user sutemp identified by carport9999
    ERROR at line 1:
    ORA-28221: REPLACE not specified
    This error is because the account does not have the 'alter user' privilege.   I'm okay with this, as I don't want our users having this privilege.
    3. I start SQL Developer 3.2, type 'alter user <me> identified by <newpwd>;' I get the same ORA-28221 error as above.   That is fine, and as expected.
    4. Now in SQL Developer, I type 'password', set a valid password, but I get 'Failed to change password' in the Script Output tab.
    I have a database 'after servererror on database' trigger set, and querying the database table it is logging into, I see a record with a date stamp matching my failure with a server_error=28221 (the same as above).
    So I'm wondering if I'm doing something wrong here, or if this is a bug in SQL Developer.   I don't want standard users having 'alter user' privileges, but I do want to enforce password verification.
    I get the same result on three 11.2.0.3 databases (haven't tried any more but suspect same results for others) and one legacy 10.2.0.4 database, and using SQL Developer 3.1 and 3.2.
    DBA_PROFILE used:
    PROFILE   
    RESOURCE_NAME  
    RESOURCE LIMIT
    CTRU  
    COMPOSITE_LIMIT  
    KERNEL     DEFAULT
    CTRU  
    SESSIONS_PER_USER  
    KERNEL     10
    CTRU  
    CPU_PER_SESSION  
    KERNEL     DEFAULT
    CTRU  
    CPU_PER_CALL  
    KERNEL     DEFAULT
    CTRU  
    LOGICAL_READS_PER_SESSION    KERNEL     DEFAULT
    CTRU  
    LOGICAL_READS_PER_CALL  
    KERNEL     DEFAULT
    CTRU  
    IDLE_TIME  
    KERNEL     DEFAULT
    CTRU  
    CONNECT_TIME  
    KERNEL     DEFAULT
    CTRU  
    PRIVATE_SGA  
    KERNEL     DEFAULT
    CTRU  
    FAILED_LOGIN_ATTEMPTS  
    PASSWORD 10
    CTRU  
    PASSWORD_LIFE_TIME  
    PASSWORD 180
    CTRU  
    PASSWORD_REUSE_TIME  
    PASSWORD DEFAULT
    CTRU  
    PASSWORD_REUSE_MAX  
    PASSWORD 5
    CTRU  
    PASSWORD_VERIFY_FUNCTION     PASSWORD VERIFY_FUNCTION_11G
    CTRU  
    PASSWORD_LOCK_TIME  
    PASSWORD .002
    CTRU  
    PASSWORD_GRACE_TIME  
    PASSWORD 21
    16 rows selected.
    Verify Function used:
    $ cat utlpwdmg.sql
    Rem
    Rem $Header: utlpwdmg.sql 02-aug-2006.08:18:05 asurpur Exp $
    Rem
    Rem utlpwdmg.sql
    Rem
    Rem Copyright (c) 2006, Oracle. All rights reserved.
    Rem
    Rem    NAME
    Rem      utlpwdmg.sql - script for Default Password Resource Limits
    Rem
    Rem    DESCRIPTION
    Rem      This is a script for enabling the password management features
    Rem      by setting the default password resource limits.
    Rem
    Rem    NOTES
    Rem      This file contains a function for minimum checking of password
    Rem      complexity. This is more of a sample function that the customer
    Rem      can use to develop the function for actual complexity checks that the
    Rem      customer wants to make on the new password.
    Rem
    Rem    MODIFIED   (MM/DD/YY)
    Rem    suren       05/09/13 - customise for NIHI use
    Rem    asurpur     05/30/06 - fix - 5246666 beef up password complexity check
    Rem    nireland    08/31/00 - Improve check for username=password. #1390553
    Rem    nireland    06/28/00 - Fix null old password test. #1341892
    Rem    asurpur     04/17/97 - Fix for bug479763
    Rem    asurpur     12/12/96 - Changing the name of password_verify_function
    Rem    asurpur     05/30/96 - New script for default password management
    Rem    asurpur     05/30/96 - Created
    Rem
    -- This script sets the default password resource parameters
    -- This script needs to be run to enable the password features.
    -- However the default resource parameters can be changed based
    -- on the need.
    -- A default password complexity function is also provided.
    -- This function makes the minimum complexity checks like
    -- the minimum length of the password, password not same as the
    -- username, etc. The user may enhance this function according to
    -- the need.
    -- This function must be created in SYS schema.
    -- connect sys/<password> as sysdba before running the script
    CREATE OR REPLACE FUNCTION verify_function_11G
    (username varchar2,
      password varchar2,
      old_password varchar2)
      RETURN boolean IS
       n boolean;
       m integer;
       differ integer;
       isdigit boolean;
       ischar  boolean;
       ispunct boolean;
       db_name varchar2(40);
       digitarray varchar2(20);
       punctarray varchar2(25);
       chararray varchar2(52);
       i_char varchar2(10);
       simple_password varchar2(10);
       reverse_user varchar2(32);
    BEGIN
       digitarray:= '0123456789';
       chararray:= 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
       -- Check for the minimum length of the password
       IF length(password) < 8 THEN
          raise_application_error(-20001, 'Password length less than 8');
       END IF;
       -- Check if the password is same as the username or username(1-100)
       IF NLS_LOWER(password) = NLS_LOWER(username) THEN
         raise_application_error(-20002, 'Password same as or similar to user');
       END IF;
       FOR i IN 1..100 LOOP
          i_char := to_char(i);
          if NLS_LOWER(username)|| i_char = NLS_LOWER(password) THEN
            raise_application_error(-20005, 'Password same as or similar to user name ');
          END IF;
        END LOOP;
       -- Check if the password contains at least one letter, one digit
       -- 1. Check for the digit
       isdigit:=FALSE;
       m := length(password);
       FOR i IN 1..10 LOOP
          FOR j IN 1..m LOOP
             IF substr(password,j,1) = substr(digitarray,i,1) THEN
                isdigit:=TRUE;
                 GOTO findchar;
             END IF;
          END LOOP;
       END LOOP;
       IF isdigit = FALSE THEN
          raise_application_error(-20008, 'Password must contain at least one digit, one character');
       END IF;
       -- 2. Check for the character
       <<findchar>>
       ischar:=FALSE;
       FOR i IN 1..length(chararray) LOOP
          FOR j IN 1..m LOOP
             IF substr(password,j,1) = substr(chararray,i,1) THEN
                ischar:=TRUE;
                 GOTO endsearch;
             END IF;
          END LOOP;
       END LOOP;
       IF ischar = FALSE THEN
          raise_application_error(-20009, 'Password must contain at least one digit, and one character');
       END IF;
       <<endsearch>>
       -- Check if the password differs from the previous password by at least
       -- 3 letters
       IF old_password IS NOT NULL THEN
         differ := length(old_password) - length(password);
         differ := abs(differ);
         IF differ < 3 THEN
           IF length(password) < length(old_password) THEN
             m := length(password);
           ELSE
             m := length(old_password);
           END IF;
           FOR i IN 1..m LOOP
             IF substr(password,i,1) != substr(old_password,i,1) THEN
               differ := differ + 1;
             END IF;
           END LOOP;
           IF differ < 3 THEN
             raise_application_error(-20011, 'Password should differ from the old password by at least 3 characters');
           END IF;
         END IF;
       END IF;
       -- Everything is fine; return TRUE ;
       RETURN(TRUE);
    END;
    alter profile ctru limit password_verify_function verify_function_11g;
    alter profile default limit password_verify_function verify_function_11g;
    alter profile web_and_it limit password_verify_function verify_function_11g;

    okay,... I just saw another website which shows I should put in the 'replace <oldpwd>' clause in.
    This works in SQL Developer:     alter user sutemp identified by carport999 replace garage999;
    So why does the 'password' command fail?     (Developers:  it would also be helpful to have the ORA- error displayed as opposed to 'Failed to change password')

  • SQL Developer can't commit edited data in Table Data pane

    When I try to commit changes in "Data" pane for selected table SQL Developer gives me a strange error:
    One error saving changes to table "TABLENAME".:
    Row XXX: Data got commited in another/same session, cannot update row.
    I can see in the log that SQL Developer tries to do something like:
    UPDATE "TABLENAME" set "COLUMN"="value1" where ROWNUM="xxxx1" and ROW_SCN=nnn1;
    UPDATE "TABLENAME" set "COLUMN"="value2" where ROWNUM="xxxx2" and ROW_SCN=nnn1;
    UPDATE "TABLENAME" set "COLUMN"="value3" where ROWNUM="xxxx3" and ROW_SCN=nnn2;
    If I update the same rows in SQL window by other condition and do commit - all is OK. Why so strange behaivour?
    My table has not a primary key and no other users try to change it. SQL Developer version 3.0.04 and Oracle 10.2.0.4 Linux.
    Best regards,
    Sergey Logichev

    That's because the inaccuracy of ROW_SCN.
    I suggest you turn off Preferences - Database - ObjectViewer - Use ORA_ROWSCN (as I did the very moment we got the option).
    Have fun,
    K.

  • Top 10 Obstacles to Sql Developer Becoming a World-class Tool

    I've been working with Sql Developer day and night for the last 6 months.
    On a positive note, the SqlDeveloper team has been the most responsive Oracle product team I've worked with in the 19 years I've been working with Oracle tools. They pay attention to their customers. It's noticed and much appreciated!
    I thought I would share the biggest problems that I face with the tool on a daily basis, the kind of problems that make me want to work with a different tool each and every day.
    My intent isn't to gripe, it's to focus attention on the biggest productivity drains I face using the tool. Others may have a different list, based on their needs. Without further ado, here is my top 10 problems list:
    1) Quality Control.
    I cannot count on critical portions of the tool working correctly. This includes an oracle database development tool that is incapable of extracting oracle ddl correctly and which is incapable of correctly displaying information about SQL Server data and database objects. It also includes destroying connection files and losing keyboard settings. When the product was installed, it was incapable of properly displaying code in a worksheet when I scrolled thru the code. The details are listed in other postings of mine.
    2) Quality Control.
    See #1.
    3) Quality Control.
    See #1.
    4) Very badly done threading.
    The tool locks up on a constant basis when it does a many tasks. Rather than let me work on some other task, I have to wait for it to complete. My current work-around is to have two or three sql developer windows open. That sucks life out of my RAM supply, but at least I can get some work done. And, of course, it will often completely lock up and never return, which means I lose all unsaved worksheets. This forum is full of postings about these issues.
    5) Memory Leaks / Internal memory corruption.
    If I've had the tool open for a few days, or really worked it hard for a day, I will get bizarre compilation errors that make no sense. If I exit the tool, re-enter the tool, and compile the exact same code all will be well.
    6) Awkward and slow data entry interface for frequently performed tasks.
    Example: I create a new table and want to start defining columns for it. I remove my hands from the keyboard to press the + button, then I have to set focus on the column name field (it should do that for me!). Now that my hands are back on the keyboard, I have to backspace the dummy "column name" value in the column name field (it should ditch that dummy value for me). Only after all that can I actually enter a column name. When I want to add a new column, it's back to the mouse again, for the same drill. The down arrow key should take me to a new column record, as should pressing return at the end of the last field in the column row.
    7) Destroys code
    Changing a column datatype from varchar2 to nvarchar2 destroys the length of the column. Changing a field on a view destroys the instead of triggers. This is bad. There is no warning that this this is about to happen, which would at least give us a chance to avoid the problem. Better still, of course, would be not destroying that data.
    8) Inaccurate checking for record locking.
    When I try to edit records in a data grid for a table, I often get an error message telling me the data was modified in another session. It is simply not true. A hand-written update statement in a sql worksheet will work just fine. I've seen posts in the forum discussing this issue. An Oracle database development tool unable to reliably update oracle data tables is embarrassing. See Obstacle #1.
    9) Unicode support
    Sql Developer is heads above all the other tools I've tried out on this topic.
    However, the configuration of the tool to provide unicode support needs to be simplified.
    The tool needs to recognize the encoding of the files that are being opened up. On Windows Vista, Notepad seems to infallibly pick the right encoding for the file when I open it. Sql Developer should do the same. Files have specific encodings, the tool should have a default encoding (that I can override). Right now, the tool has a specific encoding and expects all files to match it. Extracting ddl to a worksheet does not respect the encoding choices of the tool, either. It only works with a limited set of tool encoding choices.
    10) Resources
    Does the sql developer team have the resources they need to compete with vendors like Microsoft? One really big reason for picking sqlserver over oracle is the ease of use of the Microsoft front-end tools. It's not until later that they may realize that Oracle has more capability, but that's still a lost sale.

    We are acutely aware of quality and with each release work at improving this. Providing a polished, professional and ultimately user friendly and useful tool is our constant goal.
    The broader our customer base grows, the more demands we have. This is a good and exciting position to be in, although it might mean that we need to slow down on our release cycles.
    Release 2.0 should address more of the threading and memory leaks displayed as the team have rewritten some of the sections. As for resources, it's true we're a small team and we get on with the work that we do.It might be a little slower than some would like, but I'm not convinced that having large team is necessarily always the answer.
    As ever, some of the points mentioned could be added to the Exchange. We'll be reviewing and updating the Exchange again in the New Year.
    I think there is another point to add to your list. A lot of what the tool is and will become is from a positive customer interaction we have had to date. While we continue to grow this, I think the product will grow and improve. The forum and all the positive interactions that happen here are key to taking the product forward.
    Regards
    Sue

Maybe you are looking for

  • What is the diff b/w flat file and legacy system?

    Hi everyone,        when v say v r working on scenario FILE to FILE? which format of file r v usually working on? and what is the diff b/w flat file and legacy system? thanx

  • How do I use my new mac instead of old one with my iphone 4

    I recently just got a new Mac and wont be able to use my old Mac because I will be leaving for college in a couple weeks. My iPhone 4 is set up with my old Mac. How do i get it to sync with my new Mac now instead of my old one? Because of space on my

  • Generate Schedule Lines in PR - ME51N

    Hi, Is it possible to generate schedule lines with PR thru ME51N. Our requirement is that if we insert Delivery Date in PR line item, system ask for Schedule Line in which we insert the same as per requirement... Please suggest..how can we do it???

  • Non-stockable items - Error of G/L Account - ( Error No - ME45 )

    Hi MM Experts, While creating PO for Non-stockable items I am getting one error which says that - " You can not enter G/L account directly for the controllling area/ Co. Code". Can u pls. help on this issue.. Thanks & Regards, Mahesh

  • Looking for safe way free up flash storage on MBP 15 inch retina display?

    My MacBook Pro 15 inch with retina display is  mid 2012. 2.6 GH Intel core i7. Memory 8 GB 1600 MHz DDR3 Running OS X 10.9. 500 GB Flash Storage Use iCloud. Problem: 9.3 GB free out of 499 GB. Does anyone know of a safe,  somewhat uncomplicated way t